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


Please Help Members By Posting Answers For Below Questions

What rules are followed by the search verb.

839


What are 77 levels used for?

854


What are the different rules to perform a Search?

824


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?

1418


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

877


What are the cobol coding sheets?

872


In COBOL, what is the different between index and subscript?

959


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

2612


How to know whether the module is dynamical or statistical?

878


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2145


In which area will you utilize 88 level items in cobol?

899


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?

943


What is Pic 9v99 Indicates in COBOL?

942


How many sections are there in data division in COBOL?

895


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

953