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 |
File status must be checked both while opening and reading the file or only while reading the file?
if one main program ,n -subprograms are then which call you follow ?why reasonuhg
What are the pertinent COBOL
I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax...
when iam reading a flat file which has 100 records through cobol program when iam reading 50th records it gets abends .. so when i run the program again it should read from 50th record .where it got abened ? how it is possible
State the various causes of s0c1, s0c5 and s0c7.
how can we code index in an array of cobol pgm?
What is mean by maxcc
how to display the dataset information?
Explain how to differentiate call by context by comparing it to other calls?
what is a load module ?
01 a pic x(6) value is abcdef 01 b pic x(3) move a to b wht will be the value in b ?