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
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 |
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 |
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 |
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 |
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 |
What do you understand by psb and acb?
i need the code for this program in cobol. 2 + 1 = 3 4+3=7 6+5=11 8+7=15 10+9=19
What are different file OPEN modes available in COBOL?
whn do i get soc7 abend while moving alphanumeric to numeric or while moving numeric to aplhanumeric please reply ASAP?
what is rediffine clause?in what situation it can use?give me real time example?
What will happen if we move SPACES to numeric field and ZEROES to alphabetic field?
how can i see junk values in dclgen or in hostvariable of comp ?
i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?
77 I pic 99 value 5 Perorm para-A I times. Para -A. move 10 to I. How many times the para-A will be executed.?
What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I want Display WS-VARX and WS-VARN?
What is the difference between PIC 9.99 and 9v99 in COBOL?
0 Answers SwanSoft Technologies,
When is a scope terminator mandatory?