Why we need to use redefine clause when we can define the
variable seperately... what is actual need....
Answers were Sorted based on User's Feedback
Answer / nag(igate)
whenever declaring the file structure , the same storage
for the different records are redefined without againg
defining the same records, we used the redefined clause
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / kannan
The main use of redefines to reduce the memory allocation
for the temporary variables that is declared in WS section.
if two variables are declared in a program and if there is a
situation that the program wil use only one among that two
variables during execution depending on a condition then
redefines can be used. so that both the variable use the
same memory space and it reduces the unnecessary memory
allocation
| Is This Answer Correct ? | 5 Yes | 0 No |
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 |
Answer / ashok
yes when ever we face two type of records in the file in
that we use this redefines i will expline that best example
o1 salse-record
05 salse-re
o2 qua pic x(04).
o2 unit-pric pic x(08).
05 amount redefine salse-re pic x(12).
in this eaither we get qandity and price or amount
nobothar about it .
| Is This Answer Correct ? | 2 Yes | 0 No |
HI THIS IS ANIL. HOW TO PASS A RECORDS OF A FILE(PS OR PDS) TO AN ARRAY?
What is SSRANGE, NOSSRANGE ?
created cluster using IDCAMS ..that is empty ..when i write a program for read using Input ..wil it open the cluster or gives any error?
What should be the sorting order for SEARCH ALL?
How to replace the GOTO statement in COBOL without changing the structure of program. e.g. consider following code... I.D. E.D. D.D. P.D. compute C = A + B. GOTO para 100-display. compute D = C - D. GOTO 200-display. some other logic...... ........ GOTO 300-para. ...... ...... GOTO 400-para. Now I want to replacce all GOTO statements without changing the structure and otput of program.
How is sign stored in Packed Decimal fields and Zoned Decimal fields?
In a file if a column account number conatain value 0001234.. how can we move the value to another variable without zero. value may contain any type such as 00123405. we need the value 1234 or 12305. how can we do that in cobol. Please help.
How to recover a deleted source physical file from library?
is it possible to rename 01 level?
What are various search techniques in cobol? Explain.
What is the difference between comp and comp-3 usage? Explain other COBOL usage?s.
when SE37 SB37 and sd37 occurs how to increase the volume , primary quantity and secondary quantity?