Trying to read ISAM file via RM/COBOL [In Linux RedHat] and writes in output file. Detail Below :
# Start key is Alternate Record key = Non-Contiguous Split key. [ Can contain duplicates]
# Read Next.
Read Next is resulting in records in below order. [Prime Key is Numeric in file].
a. Prime Key 2
b. Prime Key 1
c. Prime Key 500 and so on..
Output file has records with same Alternate key.Records are not ordered on Prime key.
Questions :
a. How the records are ordered ? Are the records are ordered on Add/Update Date/Time in file or any other?
b. I want record to be ordered on Prime Key. Is this could be accomplished via changed in some Configuration setting ?
c. Is there any other document to refer other than Language/User reference for detail about Alternate Record key?
#RM-COBOLAlternateIndexISAM"How the records are ordered ? Are the records are ordered on Add/Update Date/Time in file or any other?"
The ISO Standard for COBOL requires that alternate keys with duplicate values are to be retrieved in temporal order. This is described in the RM/COBOL Language Reference as, "The order of retrieval from a set of records that have duplicate key of reference values is the original order of arrival of those records into that set."
"I want record to be ordered on Prime Key. Is this could be accomplished via changed in some Configuration setting ?"
If you have the liberty of changing the SELECT sentence for the file, you may simply add the prime key data item(s) at the end of the split alternate key and rebuild the file. If you are forced to accept the file 'as is' then you could use a SORT statement with input and output procedures, or if you are assured that the set of values is limited you could do a simple insertion sort into a table of the (unique) prime key values; at the end of the duplicate sequence, use the table to read the records using the prime key.
There is no configuration setting that can do this.
"Is there any other document to refer other than Language/User reference for detail about Alternate Record key?"
There is the ISO Standard. It gives all the rules, but may be less readable than you desire. Almost any decent COBOL textbook would give extensive coverage of indexed files. The RM Language Reference Manual is very thorough.