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
Can we redefine the field of x(200) to less than 200?
What do you understand by psb and acb?
Explain the configuration section of a cobol program with examples of syntax.
What is the LINKAGE SECTION used in COBOL?
Which mode is used to operate the sequential file?
What is the difference between binary search and sequential search?
What kind of error is trapped by on size error option?
What is the utilization of copybook in cobol?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
What is the difference between structured cobol programming and object alternativelyiented cobol?
How do you reference the fixed block file formats from cobol programs
In which area will you utilize 88 level items in cobol?
What is redefines clause in COBOL?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
Are you comfortable in cobol or jcl?