Can we use redefine clause in occurs clause?
Answers were Sorted based on User's Feedback
Answer / leroy
Answer #2 is incorrect for IBM COCOL compiler.
Answer #1 is correct but incomplete. a) "VALUE" close can
not be used in occurring fields b) Occuring fields are the
ones that will redefine other fields not the other way
round.
Example: CORRECT
01 LIT-FIELD PIC X(21) VALUE 'SUNMONTUEWEDTHUFRISAT'.
01 DAYS REDEFINES LIT-FIELDS.
05 WEEK-DAY OCCURS 7 PIC X(03).
INCORRECT:-
01 DAYS.
05 WEEK-DAY OCCURS 7 PIC X(03).
05 LIT-FIELDS REDEFINES WEEK-DAY VALUE 'SUNMONTUE.........'
Is This Answer Correct ? | 16 Yes | 2 No |
Answer / manthan
yes........we can redefine occurs clause but not having
depending clause
Is This Answer Correct ? | 6 Yes | 1 No |
Answer / jagadesh
not possible because memory allocation can not be
reallocated
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / john
All fine but, Nikhitha's Question has to be confirmed
first;
1. Whether a redefines can be used within an occurs (OR)
2. Whether an occurs can be redefined?
Looks like Nikhita's Question is 1, but all of your answers
were for Question 2.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sroul4
Redefines is just a pointer to the memory add, thus can be
done.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / saravanan
yes we can use redifines claues at level num 01... and alos
we can use both (redifine and occurs clause) together......
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / sivakumar sekharannair
Leroy's answer is correct. Redefined variable can have
occurs clause not in the same level but subordinate to the
higher level
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / subharaj
We can do that. I have done it multiple times and it works
in Enterprise Edition in mainframe.
Is This Answer Correct ? | 0 Yes | 0 No |
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?
Can we change the password using ALTER? anyone tried and changed?
sample code for read a 2nd record from last in flatfile how can do?
Can we put move statement in COBOL copybook
how to refer the data field?
what is the meaning of pic 9(09)v99-
What is the difference between CONTINUE & NEXT SENTENCE ?
if we have a 10 steps how to override the 4th step in jcl?
How can we pass data from cobol to JCl?
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
1.What is the limit of linkage section?
what is redefines? where it can be effectively use for the purpose of memory utilization? give an example?