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 |
what is scope terminator
when COMP-3 is preferrable?
What is tne need to use sub programs in Cobol?
What is the meaning of 'Eject' verb in cobol?
a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B giving d. what is ur declaration for c,d?
What is the difference between SEARCH and SEARCH ALL? What is more efficient?
How do you do in-line PERFORM?
what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?
Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS
How to retain the Duplicates in the one records?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
What is a scope terminator give example?