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



01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access..

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

01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access..

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

01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access..

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

01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access..

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

01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access..

Answer / sree

by using perform

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More COBOL Interview Questions

I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?

6 Answers   IBM,


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

0 Answers  


How many divisions we have in Cobol ?

4 Answers   Wipro,


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

0 Answers   HeadStrong,


How will 128 be saved in s9 (3) comp-3 How will 12 be saved in s9 (2) comp

3 Answers   CTS,






How to convert bunch of words in a line to relvant ASCII values?

2 Answers  


what is dynamic array in cobol? what is the difference b/w array and table in cobol?

2 Answers  


Name the sections present in data division.

0 Answers  


i want a program using by if, evaluate , string, unstring, perform, occurs?

1 Answers  


What is a subscript ?

3 Answers  


what is sync clause?

2 Answers   DELL,


What is difference between comp & comp-4?

6 Answers  


Categories