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

Why would you use find and get rather than to obtain?

0 Answers  


In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRONMENT DIVIION basically what is the difference

3 Answers   IBM,


which one is better among static call and dynamic call?

3 Answers  


I have a sequential file. How do I access a record in this sequential file randomly in my program ?

8 Answers   CGI, Xansa,


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

9 Answers  






What is the difference between comp and comp-3?

0 Answers  


What is Redefines clause?

8 Answers  


Can we call a CICS program from a batch program or viceversa?If so, how?

3 Answers  


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

0 Answers  


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..

3 Answers   iGate,


i want to learn mainframes. i completed MCA ,whats the future of mainframes

5 Answers  


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

2 Answers   TCS,


Categories