I have a table with 3 dimensions like this :
01 ws-table
04 ws-page occurs 3
08 ws-column occurs 2.
12 ws-record occurs 20 pic x(40).
How to code with PERFORM varying with 3 dimension...I
forgot..

Answers were Sorted based on User's Feedback



I have a table with 3 dimensions like this : 01 ws-table 04 ws-page occurs 3 08 ws-..

Answer / lu

you have coding like this :
Working Storage Section.
77 I-page pic 99 value zero.
77 J-col pic 99 value zeroes.
77 K-record pic 99 value zeroes.
Procedure Division.
Perform 1000-move varying I-page from 1 by 1 until
I-page > 3
after J-col from 1 by 1 until
J-col > 2
after K-record from 1 by 1 until
K-record > 20.

1000-move.
move a-field to ws-record (I-page, J-col, K-record).

Is This Answer Correct ?    12 Yes 0 No

I have a table with 3 dimensions like this : 01 ws-table 04 ws-page occurs 3 08 ws-..

Answer / garry

@Lu

Excellent Posts, I Really appreciate your time for giving wonderful and sure-shot results.

Pls keep it up.

gmt360@gmail.com

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

I have two sequential files, FILE-1 and FILE-2. FILE-1 contains 2 columns(A,B) and FILE-2 contains 3 columns (C,D,E).I want an output file, FILE-3 which has all five columns with duplicates eliminated from column A.

3 Answers  


what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.

3 Answers   HCL, TCS,


I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?

1 Answers  


What are the ways you can generate a copybook?

2 Answers  


In INITIALIZE what is Repalcing Word will do

1 Answers   CTS,






What is ASKTIME, SUSPEND

1 Answers   IBM,


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

0 Answers  


I am getting S00F abend when i try to compare two variable of different pic class,one variable is of 9(09) and another is S9(09) comp-3. First i moved the data from S9(09) comp-3 to 9(09), but no luck. So i tried to move the data from S9(09) comp-3 to X (09) and move to 9(09). I am getting same error message, Please help me to find solution for this ptoblem. ERROR MESSAGE - "The system or user abend S00F R=NULL was issued."

1 Answers  


The hierarchy of the execution of logical operators is (a) NOT AND OR (b) AND OR NOT (c) OR AND NOT (d) OR NOT AND

10 Answers   Huawei, IBM, TCS,


Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above

7 Answers   TCS,


why 02 level number can't be use as a separate level number like 01 or 77 ?

3 Answers  


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

3 Answers  


Categories