Can a REDEFINES clause be used along with an OCCURS clause?
if yes,
01 WS-TABLE.
03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE 'A'.
03 WS-EX REDEFINES WS-TABLE-EL PIC X(5). What can you
expect?
if no,why?
Answers were Sorted based on User's Feedback
Answer / guest
Hi All,
The following combinations are possible with REDEFINES and
OCCURS clause.
1.Variable at level 01 can be redefined.
2.VALUE clause cannot be used along with the REDEFINES
clause.
3.Variable having OCCURS clause cannot be REDEFINED.
4.Variable at level 01 cannot have OCCURS clause.
Please correct if any of the above points are wrong.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / vikas sharma
This clause work as when u have define this another 01 level..
We can not define like this...
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / vikas sharma
Yes, We Can.
In this question, When we display WS-EX we will get the
answer 5 times A. Like this AAAAA .
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / sunil
This works on MF-COBOL
Display WS-EX will display AAAAA
| Is This Answer Correct ? | 1 Yes | 4 No |
Answer / anoop
It is possible to use redefine class along with OCCURS
class, but you cannot redefine a table directly. So the
above code wont work.
01 ws-table
03 ws-table-el redefines ws-ex occurs 5 times pic x(1).
This is valid one.
| Is This Answer Correct ? | 3 Yes | 7 No |
How do u debug a S0C7 abend? (aswered till we get the field which caused that) After knowing the field which caused that how do u know the record which caused that if it is in production env? (dumb) Ok let us assume that we got to know that 100th record caused that and I wanted to skip only 100th record from the file and process from 101th. How to do that in JCL using SORT? (tried with STOPAFT but ended up dumb when he said smthing else is ther)
if a=b how the flow will complete??? perform test through test-exit. perform activa through activa-exit. test. if a=b then next sentence else move a to c. test-exit. exit. activa. -- -- activa-exit. exit.
At the minimum, which division of COBOL is enough to be coded?
Why would you use find and get rather than to obtain?
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
I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?
What is Static and Dynamic linking ?
why 02 level number can't be use as a separate level number like 01 or 77 ?
How to delete the records of a dataset through cobol programme?We should not use jcl utilitities like IDCAMS.
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
Can JUSTIFIED be used for all the data types?
What are the different forms of EVALUATE statement?