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
Have you used comp and comp-3 in your project? And how?
What is redefines clause in COBOL?
What are the access modes of START statement?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
Write some characteristics of cobol as means of business language.
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Why did you choose to work with ibm mainframe cobol programming?
Write the code implementing the perform … varying.
What is the Purpose of POINTER Phrase in STRING command in COBOL?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
What are the pertinent COBOL
Explain what you understand by passing by value.