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?
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
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.