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
What rules are followed by the search verb.
What are 77 levels used for?
What are the different rules to perform a Search?
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
What are the cobol coding sheets?
In COBOL, what is the different between index and subscript?
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
How to know whether the module is dynamical or statistical?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
In which area will you utilize 88 level items in cobol?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
What is Pic 9v99 Indicates in COBOL?
How many sections are there in data division in COBOL?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?