I have 2 dimensional array with having 100 elements. So how
to find the 11th item in an array?

Answers were Sorted based on User's Feedback



I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?..

Answer / dipali jaju

give subscript as 11 ,like if we have temp as table name,
then
display "temperature : " temp(11)

but if table is two dimentional then
__________________________
| 1 | 2 |
|_________ _|____________|
| | | | |
|0-25 |26-50|51-75|76-100|
|_ele_|_ele |_ele |_ele |

so to fetch 11 the record we have to write temp(1,11)

Is This Answer Correct ?    13 Yes 2 No

I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?..

Answer / sreejith

index
0 1 2 3 4 5 6 7 8 9
0 |
1-this is 11 th item in array
2
3
4
5
6
7
8
9
that is arrymame(1,0)=11th item

Is This Answer Correct ?    13 Yes 7 No

I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?..

Answer / dinesh

use INDEX by and serach it for 11th displacement.
would you want to straightly go to 11 position.
MOVE 11 to INDEX-NAME.

Is This Answer Correct ?    1 Yes 0 No

I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?..

Answer / ajay kumar ande

search for element "ajay" in name column using 2d array.suppose a table of 5*5,

procedure division
MOVE +1 TO I
PERFORM UNTILL I>5

MOVE +1 TO J
PERFORM UNTILL J>5

IF NAME = "AJAY"
DISPLAY "FOUND"
ELSE DISPLAY "NOT FOUND"

ADD +1 TO J
END-PERFORM

ADD +1 TO I
END-PERFORM

Is This Answer Correct ?    0 Yes 2 No

I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?..

Answer / ramesh

U r 100% correct neelam

Is This Answer Correct ?    1 Yes 4 No

I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?..

Answer / neelam saini

i think above answers r worng.
working-storage section.
01 WS-ARR.
02 WS-A OCCURS 10 TIMES.
03 WS-D OCCURS 10 TIMES PIC XX.
01 I PIC 9(2).
01 J PIC 9(2).
PROCEDURE DIVISION.
MAIN-SECTION.
MAIN-PARA.
PERFORM PARA1 VARYING I FROM 1 BY 1 UNTIL I > 10
AFTER J FROM 1 BY 1 UNTIL J > 10.

DISPLAY WS-D(1,2).
STOP RUN.
PARA1.
ACCEPT WS-D(I , J).

Is This Answer Correct ?    12 Yes 16 No

Post New Answer

More COBOL Interview Questions

can we use full outer join with cursors declared in cobol program?

2 Answers  


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

2 Answers   EDS,


If I want to increase the Limit in GDG. What should I do?

1 Answers   IBM,


Identify the invalid dataname from the following: (A) savings-account (B) annual-allocation-for-overhead (C) samount250 (D) 12demand

4 Answers   TCS,


What is a scope terminator give example?

0 Answers  






What is Comm?

2 Answers   IBM, Kemper Corporation,


I try to use some column names in my cobol progorm but these column not in db2 table ..when do i get error ..while bind time or runtime?

2 Answers  


Can we redefine the field of x(200) to less than 200?

0 Answers  


what happens of we dont give time stamp in precompilation process

2 Answers  


What is the Purpose of POINTER Phrase in STRING command in COBOL?

0 Answers   Winsol Solutions,


01 var1 pic x(10) 01 var2 redefines var1 pic 9(10). then in procedure division move 'abcde' to var1 then waht is the value of var1 and var2

9 Answers   HSBC,


what is dynamic array in cobol? what is the difference b/w array and table in cobol?

2 Answers  


Categories