Before creating a logical file, the physical file or files on which the logical file is based must already exist.
To create a logical file, take the following steps:
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A* ORDER HEADER LOGICAL FILE (ORDHDRL)
A R ORDHDR PFILE(ORDHDRP)
A K ORDER
This file uses the key field Order (order number) to define the access path. The record format is the same as the associated physical file ORDHDRP. The record format name for the logical file must be the same as the record format name in the physical file because no field descriptions are given.
The following shows how the CRTLF command could be typed:
CRTLF FILE(DSTPRODLB/ORDHDRL)
TEXT('Order header logical file')
As shown, this command uses some defaults. For example, because the SRCFILE and SRCMBR parameters are not specified, the system used DDS from the IBM-supplied source file QDDSSRC, and the source file member name is ORDHDRL (the same as the file name specified on the CRTLF command). The file ORDHDRL with one member of the same name is placed in the library DSTPRODLB.