I understand that HIGH-VALUES correspond to the highest in the collating sequence, however I do not understand why it may be a preferred method when using conditionals.
Example:
01 StudentRecord.
88 EndOfStudentFile VALUE HIGH-VALUES.
02 StudentID PIC X(7).
02 FILLER PIC X(23).
...
AT END SET EndOfStudentFile TO TRUE
Why not simply use VALUE 0 and SET EndOfStudentFile to 1 ?
Whats the advantage of using HIGH-VALUES in these cases?
Appreciate any input on this matter...
The conditional 88 in your example is for the
StudentRecord, so it sets/queries that. I think that it may be more appropriate to useVALUE ALL HIGH-VALUES- as it stands it will set the first byte toHIGH-VALUEand then pad the record (with spaces).VALUE 0/1would not be possible for that as the record - because it is a group - is alphanumeric, and should not be assigned a numeric value.... the question "is xyz preferred" is often more a question of style and only rarely "best practice". The commonly good thing is to ensure a consistent use/style so that others reading the code can understand it better.
In this specific case it could be used to "store" the information "all students were processed" which then can be queried later via
IF EndOfStudentFileand if for some reason there is anotherSTART >= StudentID(I assume that is anORGANIZATION INDEXEDfile here) on the file it likely will not found "another" record (still possible here, a student with an id containingALL HIGH-VALUEwould be found).