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

Answers were Sorted based on User's Feedback



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

Answer / veenaibm

Multidimentional array is as follows:

01 TABLE-REC-1.
05 ROWS OCCURS 1 TO 10 TIMES.
10 COLUMNS OCCURS 1 TO 10 TIMES.
20 CELL PIC X(1).

Now if we want to access the value of the variable CELL,

we can use
Perform x from 1 by 1 until x>10
Perform y from 1 by 1 until y>10
cell(x,y).

In the question, it is not a 2 dimentional array.

It is 2 single dimentional array which can be accessed
independently.

Is This Answer Correct ?    7 Yes 0 No

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

Answer / talluri

01 ws-array
05 ws-table1 occurs 10 times.
05 ws-table2 occures 10 times.
01 i pic 9(2).
01 j pic 9(2).
procedure division.
perform varing i from 1 by 1 until i>10
perform varing j from 1 by 1 until i>10
accept ws-table1(i,J)
accept ws-table2(i,J)
end-perform
end-perform.
perform varing i from 1 by 1 until i>10
display ws-table1(i,J)
end-perfrom.

Is This Answer Correct ?    4 Yes 2 No

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

Answer / 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

More COBOL Interview Questions

1.What is the default print format in cobol?

5 Answers   HSBC,


what is search and searchall?what is the diffrence between them?give an best example?

3 Answers   BirlaSoft,


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

0 Answers   Cap Gemini,


What is the use of EVALUATE statement?

4 Answers   Tesco,


in a indexed file what is procedure for read the records from 12 to 18. please give the code example

2 Answers   L&T,






wht is the difference between goto and perform stmts

7 Answers   DELL,


How can you add a particular field in copybook?

2 Answers   L&T,


What is reference modification? What is UNION in sql and syntax? What is the difference between GDGS and VSAM? Which is prefer one? What is processing groups in endevor?

1 Answers   Kuwait Oil Company,


What is EIBCALEN? Why it is used?

9 Answers   ADP,


What is SSRANGE, NOSSRANGE ?

5 Answers  


What are differences between COBOL and java ? why we are giving more preference to COBOL ?

3 Answers   TCS,


What rules are followed by the search verb.

0 Answers  


Categories