SAMEKEY

SAMEKEY returns a bit string of length 1 indicating whether a record that has been accessed is followed by another with the same key.

Read syntax diagramSkip visual syntax diagramSAMEKEY( x)
x
File reference. The file must have the RECORD attribute.

Upon successful completion of an input/output operation on file x, or immediately before the RECORD condition is raised, the value accessed by SAMEKEY is set to '1'B if the record processed is followed by another record with the same key, and set to '0'B if it is not.

The value accessed by SAMEKEY is also set to '0'B if:
  • An input/output operation that raises a condition other than RECORD also causes file positioning to be changed or lost
  • The file is not open
  • No current cursor position exists in the file.