Can Redefines clause be used at 01 level ?

Showing Answers 1 - 19 of 19 Answers

saravanan

  • Jul 31st, 2005
 

no.cant define a redefine clause at 01 level

  Was this answer useful?  Yes

Sriram Iyer

  • Aug 3rd, 2005
 

Redefines clause can be used at 01 Level. However the variable you are Redefining must also be declared at the Level. Infact only at 01 level you can redefine a part of the variable instead of having to Redefine for the entire length.

gowda

  • Aug 5th, 2005
 

in working storage section, redfines can be used in o1 level

  Was this answer useful?  Yes

Musarath

  • Aug 23rd, 2005
 

No...redefines Clause cannot be used in 01 level...if it is used in group level items....then redefining the whole group causes the loop to reach infinity and the program abends

  Was this answer useful?  Yes

Durga

  • Aug 30th, 2005
 

Redefines clause can be used at 01 level but both the variables must be at 01 level only. It cannot be used for records

  Was this answer useful?  Yes

arif

  • Sep 1st, 2005
 

The REDEFINES clause cannot be used in a level 01 entry in the File Section. But It can be used in at 01 level in woriking Section

surendar

  • Sep 8th, 2005
 

u can code redefines clause at 01 level

  Was this answer useful?  Yes

sharan

  • Sep 17th, 2005
 

No!!! You cannot.

  Was this answer useful?  Yes

Sanjeevkumar Koneri

  • Sep 21st, 2005
 

sharan Wrote: No!!! You cannot.

hi, sharan

     Normally we are not coding redifine clause in file section, bcoz in the file section if you have more than one 01 level entry system will automatically redefines it implicitly that is called implicit redefination as per my knowledge

sanju..

seshu

  • Jan 12th, 2006
 

Redine clause can be used at 01 level

srini

  • Jan 18th, 2006
 

we can use redifine clause at 01 level in working storage section.

  Was this answer useful?  Yes

Sivaraj

  • Feb 3rd, 2006
 

REDEFINES can be used @ 01 level.

Ex:

01 TEMP-VAR PIC X(10) VALUE '1234567890'.
01 TEMP-VAR-REF REDEFINES TEMP-VAR.     
   02 FIRST-REF  PIC X(7).              
   02 SECOND-REF PIC 9(3).              

  Was this answer useful?  Yes

pradipta

  • Feb 4th, 2006
 

yes redefine is possible in 01 level but if group1 & group2 two group items,but any one of them can be in use at a time then we will go for redefine.So if the both the group are using same no. of charectersor of same size.

  Was this answer useful?  Yes

varun Kakkar

  • Apr 7th, 2006
 

We CAN use REDEFINES at 01 level  irrespective of the PIC clause of the 2 variables if the REDEFINED variable is also at 01 level. 

  Was this answer useful?  Yes

Kiran

  • Apr 17th, 2006
 

Hi,

We can redifine a varialbe of 01 level with a variable of another 01 level only.

The redifination can be of any length.

  Was this answer useful?  Yes

kanu

  • Jul 23rd, 2006
 

Hi,

u r right as it is mentioned in refrence guide but i m not able to understand wat is implicit redifination.

  Was this answer useful?  Yes

intiaz ali

  • Oct 14th, 2006
 

No, We can't able to use occur clause for any group item.

  Was this answer useful?  Yes

mustafa

  • Feb 16th, 2007
 

yes we can

  Was this answer useful?  Yes

Ganesh

  • May 30th, 2007
 

We can redefine at 01 level...

For those who said 'Can't use redefine at 01 level', Please think twice before answering any question.

  Was this answer useful?  Yes

Alok

  • Jun 14th, 2007
 

We cannot use REDEFINE clause on 01 level.

I have tested it and it will give you compilation error.

Thx...

  Was this answer useful?  Yes

J.B.Deepa

  • Jun 18th, 2007
 

The REDEFINES clause cannot be used in a level 01 entry in the File Section.

  Was this answer useful?  Yes

Murali

  • Jun 22nd, 2007
 

Redefines clause can be used at 01 level, except that in case if 01 level, data-name-1 cannot exceed data-name-2.

  Was this answer useful?  Yes

Muraleedharan

  • Aug 22nd, 2007
 

Surely we can use the redefine clause at 01 level, but the only condition is that both the redefined and redefining item should be done at the same level.

  Was this answer useful?  Yes

haiardhan

  • Feb 7th, 2009
 

*1) USING SAME MEMORY SPACE FOR DIFFERANT ENTRIES.
*2) THE ENTRIES SHOULD BE IN SAME LEVEL.

*3) THE REDEFINS LENGTH OF THE REDEFINED SHOULD BE *LESS, IF 3RD LEVEL HAS COME IMMEDIATLY

*4) THE LENGTH OF THE REDEFIND NEED NOT BE =/>/< ?IN FIRST LEVEL.?
if you code like below it will give error like
*******Original item is smaller than redefinition (5 < 7).

. ?????? IDENTIFICATION DIVISION.
?????? PROGRAM-ID. REDIFINE.
?????? ENVIRONMENT DIVISION.
?????? DATA DIVISION.
?????? WORKING-STORAGE SECTION.
?????? 01 WS-NAME PIC X(16) VALUE IS 'RANAPR'.
?????? 01 WS-OUTNAME REDEFINES WS-NAME.
??????????????? 05 FIRSTNAME PIC? X(6) .
??????????????? 05 LASTNAME PIC X(5).
??????????????? 05 LASTNAM REDEFINES LASTNAME.
?????????????????? 06 AD PIC X(2).
?????????????????? 06 AV PIC X(5).
????? *Original item is smaller than redefinition (5 < 7). :?
?????? PROCEDURE DIVISION.
?????????? DISPLAY WS-NAME.
?????????? MOVE 'RAMANARAJU' TO FIRSTNAME.
?????????? MOVE 'PRATAPSINGH' TO LASTNAME.
?????????? DISPLAY WS-OUTNAME.
?????????? STOP RUN.

  Was this answer useful?  Yes

haiardhan

  • Feb 7th, 2009
 

Yes, we can use redefines clause in 01 level. You can run this below code it will smoothly runs

User-name required :FOR FILLER
     *USING SAME MEMORY SPACE FOR DIFFERENT ENTRIES.
      IDENTIFICATION DIVISION.
      PROGRAM-ID. REDIFINE.
      ENVIRONMENT DIVISION.
      DATA DIVISION.
      WORKING-STORAGE SECTION.
      01 FILLER PIC X(30).
       01 MYNAME REDEFINES FILLER.
               05 FIRSTNAME
PIC X(14) .
               05 LASTNAME PIC X(15).
      PROCEDURE DIVISION.
          MOVE 'JANARDHAN' TO FIRSTNAME.
          MOVE 'MANCHIKANTI' TO LASTNAME.
          DISPLAY MYNAME.
          STOP RUN.

If you replace filler with some other name like your name, it will work for 01 level.

  Was this answer useful?  Yes

masthan

  • Oct 5th, 2011
 

we can use at 01 level and actually rule of redefines clause: Redefining and redefined fields must be at same level numbers. and for redefining memory must be same or shorter.

  Was this answer useful?  Yes

PKK

  • Dec 9th, 2011
 

The REDEFINES clause can be used when the two data items have the same level number. The exceptions are when the special purpose 66 or 88 level numbers are used and when the level number is at 01 in the FILE SECTION, in which case the a REDEFINES clause cannot be used.

Above details are from the book Structured CObol by Philippakis.

  Was this answer useful?  Yes

Ramesh

  • Jun 16th, 2012
 

Yes...You can define redefines clause at all levels except 66 and 88 in working-storage section....where as in file section we cant redefine at 01 level..other than this you can...and you cant redefine at occurs clause level...

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions