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!

Start Greater Than query

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can any body help me with this poser. If I have an index file where the key is a 9(7) comp and the first record contains zeroes why does a move low-values to the key and a start greater than/read next statement miss the zeroes record and reads in the one following.

If you move zeroes to the key and do a start not less than then the record is read.

Any ideas?
 
Hi,
Since your key is comp (packed), low-values is the same as zeros.
 
mrregan,
Many thanks for clearing that up for me. Is the use of Start not less than, moving zeroes to the key the best method when dealing with keys that are COMP fields then?
 
Open for input, read ... and you get the first record! No problemo...?
 
why not start not less than? If you do not like my post feel free to point out your opinion or my errors.
 
The operating system makes a difference. On the IBM mainframe, the last character in a packed field is always a sign character (even when unsigned), so low values is lower than Zero. VSAM (and, I expect, other indexed files) consider the keys to be binary, no matter how the COBOL program defines the key.

Stephen J Spiro
 
Actually, COMP is more often BINARY than PACKED-DECIMAL, though, of course, there is no standard, and in BINARY the ZERO is indeed LOW-VALUES.

Betty Scherber
Brainbench MVP for COBOL II
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top