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
In COBOL programming, what is PERFORM? What is VARYING?
how to refer the data field?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
Explain the configuration section of a cobol program with examples of syntax.
Name the sections present in data division.
what is the use of outrecord?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What are declaratives and what are their uses in cobol?
What rules are to be followed while using the corresponding options?
Which Search verb is equivalent to PERFORM…VARYING?
Which is not true about evaluate statement
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
Explain how you can characterize tables in cobol?
What type of SDLC u followed? Why?
How to remove 2 duplicate records and copy only one using job control language?