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 |
How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Numerics ?
What is Comm?
2 Answers IBM, Kemper Corporation,
In COBOL, what is the different between index and subscript?
0 Answers TryTechnicals Pvt Ltd,
COMP-3 field occupy ?
How do you define a variable of comp-1 and comp-2?
Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 10 bytes . There should be some difference between two allocations ? Thanks krishna chaitanya
example for sub strings ? and refernce modifications whit output pls
0 Answers College School Exams Tests, IBM,
can we print comp 3 stmts how ?
Can we dynamically increase the size of occurs clause? i.e In case I an not sure of the size of array and want to increase the size at run time.If yes , how?
give the examples of strings in cobol
how to pass 100 to s9(4) how r they inserted ?
what is the difference between PA & PF keys?