NCL supports both sequential and generic retrieval from keyed data sets. Such functions imply that a current position within the file is maintained so an NCL procedure can simply request the next record and it will be supplied. No incrementing of keys by the NCL procedure is necessary.
Under certain circumstances, such as with generic retrieval, it might be necessary to alter the retrieval sequence and commence retrieval using a different key.
NCL must be informed that such a change is required and that the current retrieval sequence is to be stopped. This is done using the &FILE GET ID=name OPT=END statement. This indicates to NCL that generic retrieval is to be terminated in anticipation of some other processing.
If an end-of-file condition is signaled, no &FILE GET ID=name OPT=END is required. The use of a non-generic function, such as the specific retrieval of a record, or the use of the KEY= or KEYVAR= operand on the &FILE verb to set the current key, will also cancel a previous generic function.
You can use KEY=' ' and the generic option together, in which case the key is used to gain initial position for the generic retrieval. Subsequent generic retrieval requests continue from this position, as long as the key supplied (if any) is the same as the initial key.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |