How do u sort the table for Search ALL? Is it only using
ASCENDING KEY IS statement in occurs clause? If the data is
input in non ascending order, will the ASC KEY IS
automatically sort the data? or will it throw compile time
error?
for using SEARCH ALL your table must be defined with KEY IS
along with the OCCURS caluse and INDEXED BY.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 XXX-TABLE.
03 XXX-TEXT PIC X OCCURS 10 TIMES
ASCENDING KEY IS XXX-TEXT
INDEXED BY AXIDX.
In the above case my table is ordered in ascending sequence.
i can order my table in descending sequence also.
01 SRCHXXX PIC X.
01 XXXPOS PIC 99.
PROCEDURE DIVISION.
Begin.
ACCEPT SRCHXXX
SET AXIDX TO 1
SEARCH ALL XXX-TEXT
AT END DISPLAY "NO LETTER FOUND"
WHEN XXX-TEXT(AXIDX) = SRCHXXX
SET XXXPOS TO AXIDX
DISPLAY SRCHXX " IS IN " XXXPOS
END-SEARCH
STOP RUN.
If data input in non ascending order, the ASC KEY will not
automatically sort the data
| Is This Answer Correct ? | 10 Yes | 0 No |
What is the meaning of 'TALLING' verb in cobol?
CAN ANY ONE HELP WHAT IS QTP? why it is nessery AND WEN IT IS USED?
The order of precedence of arithmetic operators in an expression can be overridden with the use of (a) [] (b) () (c) {} (d) Any of the above
Can we use goto statement in inline_perform ?
what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.
given the following: 77 A PIC 9V9 VALUE 9.5 77 B PIC 9 VALUE 9. 77 C PIC V9 VALUE 0.8 77 D PIC 9 77 E PIC 9 77 F PIC 9V999 what are the contenta of D E nad F after the following statements are executed: COMPUTE F ROUNDED=A+C/B MULTIPLY A BY C GIVING E ADD B C A GIVING D ROUNDED a.F=9.589 E=8 D=1 b.F=9.589 E=8 D=9 c.F=9.589 E=7 D=9 d.F=9.589 E=7 D=1
what is Reentrancy and Quasi-reentrancy?
Why we are using comp and comp-3 in real time projects?
why we are using set in searchall?
What is rmode(any) ?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
how can we find total no of records in a file ....is there any utility......?