Why we need to use redefine clause when we can define the
variable seperately... what is actual need....

Answer Posted / vaneesh

One more advantage of redefines is that we can use the same
value with different declarations.
For Example
lets say we receive input value as 'b123'. b is blank
and we want to display it as 01.23 in the spool. This can
be done with redefines as follows.

WORKING-STORAGE section
01 LEARNING
05 WS-RECIEVE-VAL PIC X(4).
05 WS-RECIEVE-RED REDEFINES WS-RECIEVE-VAL PIC 9(2)V
(2).

01 WS-FOR-DISPLAY PIC 9(2).9(2).

PROCEDURE DIVISION.

MOVE 'b123' TO WS-RECIEVE-VAL
MOVE WS-RECIEVE-RED TO WS-FOR-DISPLAY

DISPLAY WS-FOR-DISPLAY

STOP RUN.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In COBOL programming, what is PERFORM? What is VARYING?

668


how to refer the data field?

1801


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

1586


Explain the configuration section of a cobol program with examples of syntax.

654


Name the sections present in data division.

697






what is the use of outrecord?

1766


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

851


What are declaratives and what are their uses in cobol?

706


What rules are to be followed while using the corresponding options?

630


Which Search verb is equivalent to PERFORM…VARYING?

679


Which is not true about evaluate statement

1567


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

731


Explain how you can characterize tables in cobol?

636


What type of SDLC u followed? Why?

1516


How to remove 2 duplicate records and copy only one using job control language?

735