how will u retreive value from a table.write it with syntex.
01 ws-table
05 ws-table1 occurs 10 times.
05 ws-table2 occurs 10 times.

the above is 2 dimensional array..how will u retrieve 1st
element of an array

Answer Posted / abhishek

while declaring a two dimensional array we have to use the
INDEXED BY clause

01 ws-array
05 ws-table1 occurs 10 times INDEXED BY I
10 ws-table2 occures 10 times INDEXED BY J
15 var-1 pic x(4)
15 var-2 pic x(5)

01 i pic 9(2).
01 j pic 9(2).

procedure division.
perform varing i from 1 by 1 until i>10

AFTER varing j from 1 by 1 until i>10
accept var-1(i,J)
accept var-2(i,J)

end-perform.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different rules for performing sort operation?

766


What is amode(31)

726


Name some of the examples of COBOl 11?

2688


How to know whether the module is dynamical or statistical?

658


What are various search techniques in cobol? Explain.

650






write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

714


how to convert the recors form vsam file to db2 table tru file aid

2765


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1933


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

5695


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1846


what is amode(24), amode(31), rmode(24) and rmode(any)?

705


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

427


What are all the divisions of a COBOL program?

667


What do you understand by psb and acb?

668


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

661