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
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
What are 77 levels used for?
What is the use of intialize verb?
What is a report item?
What is comp-1 and comp-2?
What is the difference between Global and External Variables?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What is the problem of ordered sequential files access?
Differentiate between structured cobol programming and object-oriented cobol programming.
how to convert the recors form vsam file to db2 table tru file aid
What are the pertinent COBOL commands?
In which area will you utilize 88 level items in cobol?
What is perform what is varying?
how do you reference the rrds file formats from cobol programs
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.