01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2
times. My qustion is how can we access the second name
Answers were Sorted based on User's Feedback
Answer / veena
occurs can never be used in the 01 level. and when the
clause is used in 02 level, the variable has to be in the
level below that.
01 ws-name1.
02 ws-name2 occurs 2 times.
03 ws-name. pic x(10).
and also pic clause cannot be used in the same statement of
the occurs clause.
Is This Answer Correct ? | 16 Yes | 7 No |
Answer / venkat
The OCCUR keyword can not be used in 01 level variable. But
it can be used in level below 01.
Eg:
01 WS-NAME.
02 WS-NAM-X PIC X(10) occurs 2 times.
01 Ws-TEST PIC X(10) value spaces.
We can access the second name variable WS-NAM-X(2).
Eg 1. MOVE WS-NAM-X(2) to Ws-TEST.
2. Display WS-NAM-X(2).
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / sriharichallagundla
occurs can never be used in the 01 level. and when the
clause is used in 02 level, the variable has to be in the
level below that.
01 ws-name1.
02 ws-name2 occurs 2 times.
03 ws-name. pic x(10).
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / m.raghu
01 ws-name.
02 ws-name1 occurs 2 times.
03 ws-name2 pic x(10).
we can refer to second occurence element is: ws-name1(2).
Is This Answer Correct ? | 4 Yes | 0 No |
Why would you use find and get rather than to obtain?
In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRONMENT DIVIION basically what is the difference
which one is better among static call and dynamic call?
I have a sequential file. How do I access a record in this sequential file randomly in my program ?
i have the following varibles in the working storage 05 ws-A PIC X(30) VALUE 'ABCDEFGHIJKLMNOPQRESTUVWXYZ ' 05 WS-B REDEFINES WS-A 10 WS-B1 PIC X(10). 10 WS-B2 PIC 9(10). 10 WS-B3 PIC X(10). If I Display B1, B2 and B3 respectively, what is the value displayed in B2
What is the difference between comp and comp-3?
What is Redefines clause?
Can we call a CICS program from a batch program or viceversa?If so, how?
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
I have a Main Program which is calling Sub-Program which is a DB2 pgm. What will happen if I am not closing the cursor used in the Sub-program? Please advise..
i want to learn mainframes. i completed MCA ,whats the future of mainframes
what is the size of W-REC in the following 01 W-REC 05 A PIC 9(4)V99 05 B READLINES A 10 C PIC XX 10 D PIC S9(4) 05 E OCCURS 7 PIC ZZ.ZZ 05 F OCCURS 5 10 G PIC ZZ.ZZZ99 10 H OCCURS 3 15 J PIC 9(3) 15 K PIC V99