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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

High-Values - How do I use it? 2

Status
Not open for further replies.

gust1480

Programmer
Mar 19, 2002
148
PH
I have read that High-Values is handy in dealing with sorted data to determine whether you are at the end of it. So, can somebody please give me an example of how to use it?


Jimmy
 
Gust,
High-values can be used for a number of end-of situations, not just sorts. For instance, you may have a file that has a header record with a key of low-values and a trailer with a key of high values. The trailer may contain a records count for testing purposes.

In these circumstances you could:
PERFORM XA-READ
UNTIL KEY-FIELDS = HIGH-VALUES
PERFORM MAIN-PROCESSING
END-PERFORM
PERFORM END-OF-FILE-PROCESS

Or something similar. Let me know if this is of any help.
Marc
 
Hi Jimmy,

High-Value contains the highest value in the coalating sequence: X'FF'; Low-Value, the lowest: X'00'. As Marc mentioned, they're used for the key values of trailer and header recs, respectively.

This comes in handy for a SORT because the Header winds up as the 1st rec when the sort is complete and the trailer, the last. Provided you don't assign High or Low Vals to one of the "body rec" keys. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top