Overview (POINT command)
POINT establishes
the location at which sequential access begins (or resumes) in a keyed
file. A keyed file is a file that provides access to information by
a record key. An example of a keyed file is a file containing a social
security number and other information about a firm's employees. The
social security number can be used to identify the records in the
file. For additional information about keyed files, see KEYED DATA LIST.
POINT prepares
for reading the key-sequenced dataset sequentially from a point that
the key value controls. Data selection commands can then be used to
limit the file to the portion that you want to analyze. A DATA LIST command is used to read the data.
To read keyed files (and also direct-access files), see KEYED DATA LIST.
Basic Specification
The basic
specification is the KEY subcommand
and a string variable. The value of the string variable is used as
the file key for determining where sequential retrieval (via DATA LIST) begins or resumes.
Subcommand Order
- Subcommands can be named in any order.
- Each
POINTcommand must precede its correspondingDATA LISTcommand.
Syntax Rules
-
POINTcan be used more than once to change the order of retrieval during processing. -
POINTmust be specified in an input program and therefore cannot be used to add cases to an existing file.
Operations
- The next
DATA LISTcommand that is executed after thePOINTcommand (for the same file) will read a record whose key value is at least as large as the value of the specified key. To prevent an infinite loop in which the same record is read again and again, the value of the variable that is specified onKEYmust change from case to case, or thePOINTcommand must be set up to execute only once. - If the file contains a record whose key exactly matches the value
of the
KEYvariable, the next execution ofDATA LISTwill read that record, the second execution ofDATA LISTwill read the next record, and so on. - If an exact match between key and variable is not found, the results depend on the operating system. On IBM implementations, reading begins or resumes at the record that has the next higher key. If the value of the key is shorter than the file key, the value of the key variable is logically extended with the lowest character in the collating sequence. For example, if the value of the key variable is the single letter M, retrieval begins or resumes at the first record that has a key (regardless of length) beginning with the letter M or a character that is higher in the collating sequence.
-
POINTdoes not report on whether the file contains a record that exactly matches the specified key. To check for missing records, useLISTto display the data that were read by the subsequentDATA LISTcommand.