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 are various search techniques in cobol? Explain.

650


What is an in line perform? When would you use it? Anything else you wish to say about it.

649


Can a Search can be done on a table with or without Index?

806


What is difference between static and dynamic call in cobol?

779


What is report-item in COBOL?

711






What is the difference between PIC 9.99 and PIC9v99?

783


Why occurs cannot be used in 01 level in COBOL?

719


What is length is cobol?

652


What is Pic 9v99 Indicates in COBOL?

729


What is perform what is varying?

711


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?

1232


Explain the configuration section of a cobol program with examples of syntax.

661


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2107


Explain about different table spaces.

650


How you can characterize tables in cobol?

721