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

File status must be checked both while opening and reading the file or only while reading the file?

2 Answers  


if one main program ,n -subprograms are then which call you follow ?why reasonuhg

4 Answers   UHG,


What are the pertinent COBOL

0 Answers   IBM,


I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax...

2 Answers   CTS, DSRC,


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

1 Answers   Patni,






State the various causes of s0c1, s0c5 and s0c7.

0 Answers  


how can we code index in an array of cobol pgm?

1 Answers   Wipro,


What is mean by maxcc

7 Answers   Syntel,


how to display the dataset information?

2 Answers  


Explain how to differentiate call by context by comparing it to other calls?

0 Answers  


what is a load module ?

3 Answers   TCS,


01 a pic x(6) value is abcdef 01 b pic x(3) move a to b wht will be the value in b ?

3 Answers   Patni,


Categories