Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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?

Answer Posted / snehatechm

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

) how do u code after getting data?

2206


explain sorting techniques in cobol program?

1238


What is the Purpose of Pointer in the string?

1119


I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

2599


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

1496


How to print 10 to 1 if the input have only 10 digit number?

1304


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

1381


What is report-item in COBOL?

1194


how do you reference the rrds file formats from cobol programs

1652


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

1481


What is the default value(s) for an initialize and what keyword allows for an override of the default?

1261


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

3317


What is comp-1 and comp-2?

1277


Name the divisions, which are available in a cobol program?

1292


What are the different rules for performing sort operation?

1272