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 |
CAN ANY ONE HELP WHAT IS QTP? why it is nessery AND WEN IT IS USED?
How to define variable 9(20) in COBOL, because compiler does not allow us to declare variables with Pic 9(18). Can anyone please let me know the answer... I know one answer to this question which is to use Compiler option Arith (Extend) during Compilation. It extends the maximum limit to 9(32)..Just wanted to know if there is any other way to extend this?
In COBOL CALL-CALLING,if a program A is calling 3 sub- programs, dynamically, then it is said sub-programs will always will always in Initial Mode. My question is : Do we need to code CANCEL or (IS INITIAL) for dynamically called sub-programs or it is the property of Dynamically called pgms so every time sub-pgms are called they will be in initial mode. ***This question is only Dynamic call****, Please reply. Thank you in advance.
i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
what happens if parmparameter passes zero bytes to the program
DATAONLY, MAPONLY functionality?
Without using move verb how to move one variable to another.
how will you define vsam file in select clause?
I want to declare a field with data type Double in my COBOL program. how shall i do that ?
How do u initialize an array?