NCL File Processing › Work with UDBs › Prepare to Use a UDB
Prepare to Use a UDB
The process to create and use a UDB is:
- Determine the format of the data set, the length of the records it is to contain and the size of the key to be used. If records are to be added or updated on-line, the key must commence in the first position of the record (unless the data set is to be processed in unmapped mode). The amount of space required should also be determined at this stage. Remember to take the presence of field separators into account when deciding on record length. Normally field separators have little effect on overall record length, but they can become significant when a record contains numerous very short fields.
- Use the IDCAMS VSAM utility to define the data set. The DEFVSAM member in the distribution library contains an example of defining a VSAM data set.
- Allocate the file dynamically with the ALLOCATE command.
- Use the UDBCTL command to open the UDB and assign a logical file ID, and any special processing attributes that might be required. This makes the file available for processing.
- Include the appropriate &FILE OPEN statement in the NCL procedure.
After these steps have been performed, the file is available for processing using standard NCL statements.