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
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 |
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 |
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 |
01 a pic x(4) value 'abcd' 01 b pic 9(3) can we move from a to b.if possible what would be stored in b.
I am sending values a and b with pic x(10) and pic x(10) by using call statement. In linkage section, I am receiving values with pic x(10) and pic x(11). Will my program fail? will it be compile error or run time abend?
if a dataset is already created with fixed length but after that i want to change fixed length to variable length then how is it possible
i have n records in one file and in this file there is some fields and i want to count that how many sharma in my file so plz give the coding that how we read sharma ?
What is the difference between perform … with test after and perform … with test before?
How do you define a sort file in JCL that runs the COBOL program?
i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,copy,write operations).plz give me details of all posible JCL utilities?
is this below syntax correct? CALL 'subprg' using A,B Please help
I have a seq file with different fields one field is address with pic x(50) as input in a cobol program. In address there is 'PUNE' at any different positions in the address field ( form 1 t0 50) . My requirement is select the fields with address 'PUNE' by using cobol. Please suggest
i need a program by giving input as a abcd in any randem order but i need a output as 1234 related to abcd. i.e,. a for 1,b=2,c.....etc..
What is the difference between NEXT SENTENCE and CONTINUE?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?