Explain about Redefines cluse?

Answers were Sorted based on User's Feedback



Explain about Redefines cluse?..

Answer / amit barwa

REDEFINES Clause
Facilitates two or more data-names to point to the same
memory location
e.g.

01 WS-NUM1 PIC X(1)

01 WS-NUM2 REDEFINES WS-NUM1 PIC X(2).

If you MOVE '10' to WS-NUM2,

DISPLAY WS-NUM1 will show 1 while

DISPLAY WS-NUM2 will show 10.

Is This Answer Correct ?    7 Yes 0 No

Explain about Redefines cluse?..

Answer / avinanda mukherjee

If the example is-

01 WS-NUM1 PIC 9(1)

01 WS-NUM2 REDEFINES WS-NUM1 PIC X(2).

If you MOVE '10' to WS-NUM2,

DISPLAY WS-NUM1 will show 0 (Numeric) while

DISPLAY WS-NUM2 will show 10 (charecter).

Is This Answer Correct ?    5 Yes 1 No

Explain about Redefines cluse?..

Answer / mallappa

Redfeines Clause allows you to use a same memory area.
Ex:
01 var.
02 ws-date pic x(10).
02 ws-date1 Redefines ws-date
03 ws-day pic x(2).
03 ws-month pic x(2).
03 ws-month pic x(8).

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More COBOL Interview Questions

What kind of error is trapped by on size error option?

0 Answers  


how to access vsam files in cobol and how to differentiate that this is ESDS file

1 Answers   EDS,


how do u link sub pgm to main pgm ?

2 Answers   TCS,


How to resolve the soc4 & soc7 other than following answers. Soc4 can resolved using mispleed dd name and dd name is not matching with file and soc7 check the sysdump and copy the offest address then correct it in the program.

10 Answers   ADP, Amdocs, Cap Gemini, Keane India Ltd, Super Value, TCS,


how do you reference the fixed unblock file formats from cobol programs

0 Answers  






WHY LRECL NEEDS TO BE 4 EXTRA THEN THE COBOL FILE LENGTH & WHAT IT CONTAIN IN THAT LENGTH

2 Answers   Cap Gemini,


what are the diferences b/w sub-script and index?

4 Answers  


i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk values pls say how to do ths reply fast

4 Answers   L&T,


how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).

2 Answers   DELL, Mind Tree,


I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.

2 Answers   L&T,


COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.

7 Answers   HCL,


what is label record is standard or omitted in file description of data division?

3 Answers   IBM, TCS,


Categories