Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing indexed files to sort on

Status
Not open for further replies.

D2BEA

Technical User
Mar 13, 2001
41
US
I have (2) files the master file and the index file. I want to sort the master file and then the indexed file separately. Any suggestions on how I might go about this? I am new to indexed files.
 
Hi BEA,

An indexed file usually presumes a defined sequence dictated by the key values of the index field(s). Usually you sort the flat file in the sequence of the indexed file.
However, if the indexed file is appreciably smaller (# of recs) than the flat file you may want to copy the indexed file and sort it in the sequence of the orig flat file.

How to sort the files depends on the platform you're running on. Why don't you let us know; my background is in mainframes, but I'm sure there's plenty of help out there for the other platforms. So let us know. Also, if you have any code to show us, that can give an insight for what you're trying to do and the problems you face.

Thanx, Jack.
 
I am using micro focus cobol and the indexed file is already created. I want to search for last names on both the master file and the indexed file.
 
You've got to explain what you're trying to do in a little more detail.

Do you read the master, find the matching index rec and combine some data fronm both and write a rec to a new file? Do you read the indexed, match it to the master? What is the purpose of the pgm? You said you want to sort the files. Why?
 
The purpose of the program is that I want to sort by last name and first name from the master file and it's indexed file and display all the records on the screen. I am not sure how to go about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top