Renaming Record-Format Names

Many of the functions that you can specify for externally described files (such as the CHAIN operation) operate on either a file name or a record-format name. Each file and unqualified record-format name in the program must be a unique symbolic name. If your file is qualified, so that the record formats are specified in the form filename.fmtname, the names of the formats do not have to be unique within the program.

To rename a record-format name, use the RENAME keyword on the file description specifications for the externally described file as shown in Figure 157. The format is RENAME(old name:new name). Remember that even if the file is qualified, you do not use the qualified form of the name with the RENAME keyword.

Figure 157. RENAME Keyword for Record Format Names in an Externally Described File
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *
FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++++++
FITMMSTL   IP   E           K DISK    RENAME(ITEMFORMAT:MSTITM)
 *

The RENAME keyword is generally used if the program contains two files which have the same record-format names. In Figure 157, the record format ITEMFORMAT in the externally described file ITMMSTL is renamed MSTITM for use in this program. An alternate solution to the problem of having record formats from different files with the same name is to define the files as qualified, using the QUALIFIED keyword. The record formats of a qualified file are specified in the form filename.formatname, so it does not matter if the format name is the same as another name within the program.



[ Top of Page | Previous Page | Next Page | Contents | Index ]