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 |
TYPES OF SORTINGS. which is more prefarable.
In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?
hi dudes.....can any one help me..... what is SET TO TRUE all about,anyway?
Can the OCCURS clause be at the 01 level?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
how do you reference the rrds file formats from cobol programs
When the working storage variables get allocated? a.At Compile time b.At starting of the run time c.At end of the run time. d.None of these
How to read records in reverse order in flat file? I know we can do it by reading all records into an array.... Then read records in reverse order by using subscript or index but can any body give me the exact code.
How to delete the records of a dataset through cobol programme?We should not use jcl utilitities like IDCAMS.
What is diff between vsam and db2?what is advantage of db2 over vsam?which is best suited one?
How do u sort the table for Search ALL? Is it only using ASCENDING KEY IS statement in occurs clause? If the data is input in non ascending order, will the ASC KEY IS automatically sort the data? or will it throw compile time error?
I have sequential file recl 1000 i want to add another 15 bytes to it. The record length should not change..How?