When a record is read from the UDB, whether it is a delimited format or an unmapped format file, NCL normally performs the following steps when preparing the data for presentation to the procedure, regardless of the key under which the record has been retrieved.
The significant point here is that the key under which the record is retrieved is not, by default, regarded by NCL as part of the record data and does not therefore appear in the &FILE GET variables.
The result of this is that the same fields within a given record can be relocated into different &FILE GET variables, depending upon which key is used to read the record.
Previous figures show that when the records in the example are read by successive &FILE GET statements, the two separate fields of which the records are composed are placed into the two variables &1 and &2, as expected. &3, specified on the &FILE GET statement, is set to null since no data was available to place into it.
However, a different &FILE GET results when the alternate index is used to read the same two records. NCL has obeyed the rules for data presentation with the following result:
Note: When processing with alternate indices the positioning of the alternate key can significantly impact the way in which an NCL procedure must process the UDB. It is therefore recommended that you familiarize yourself with this process and try a few simple examples first, to ensure you understand it.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |