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 |
hi dudes.....can any one help me..... what is SET TO TRUE all about,anyway?
Which is not true about evaluate statement
how will u find out 3rd week's 2nd day using occurs ?
Read a flat file and write last but one (I have n records in a file I have to write n-1th) record in another flat file. Could you please provide me the code in COBOL?
What guidelines should be followed to write a structured cobol prgm?
What is the different between index and subscript?
How many types of sorts are there in cobol?
If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?
I have a file it contain 10 records.i got abend at 8th record because of soc7.how do you know that perticular record got abend?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
If I want to increase the Limit in GDG. What should I do?
How to read records which is in sequential file in reverse order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my doubt any one