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

Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

0 Answers  


I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?

1 Answers  


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

2 Answers   HCL,


What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(9) VALUE SPACES. 01 WS-VARN REDEFINES WS-VARX PIC 9(9).

8 Answers  


Can we put move statement in COBOL copybook

3 Answers   Global Logic,






In a program, there are 2 sections defined say SECTION-A and SECTION-B. There is a paragraph say CALC-INT in both the sections. If this para has to be called directly for SECTION-A, then PERFORM CALC-INT will not work as it is present in both sections. How the PERFORM statement has to be coded here?

5 Answers  


01 a pic s9(5) value '-12345' how it will be stored

7 Answers   ACS,


if i am reading a file with some 50000 records and moving to a DB2 table and suddenly the program abends in between, is there anyway i could restart from the exact record at which the job failed once the program restarts.

2 Answers   UST,


What is the difference between a binary search and a sequential search?

10 Answers  


Write the code implementing the perform … varying.

0 Answers  


there is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially.then which of the access mode would you specify? a.SEQUENTIAL b.RANDOM c.DYNAMIC D.ACCESS MODE has nothing to do with it

3 Answers   TCS,


How to increase the logical record length of existing PS file?

7 Answers  


Categories