Temporary datasets

During mapping, temporary datasets are allocated as needed, depending on two factors:

One temporary dataset is allocated in all cases, which is a general use work file. One temporary dataset is also allocated for each input. Depending on how the map is constructed, it may create a temporary dataset for each output to serve as its work file.

In addition, one temporary dataset is always allocated for each input or output defined with an RECFM that is not F (fixed unblocked) or FBS (fixed blocked standard).

Because you can develop a map with no inputs, and output work files may not be used in some situations, the minimum number of possible temporary files for a map execution is 1. The maximum possible number is 1 + (2 * number of inputs) + (2 * number of outputs). Temporary files will be allocated using this formula where you have specified in the map to create output work files during its execution and all the inputs and outputs are formatted with a RECFM other than F or FBS.

By default, temporary datasets are dynamically allocated on disk. Dynamically allocated datasets require no DD statements in the JCL and can store up to approximately 3.1 MB of data. This is based on the settings specified in the ALLOCxx PARMLIB member. These datasets are deleted at the end of mapping and have system-generated dataset names with low-level qualifiers of CTMFnnn, where nnn is a number indicating the sequence in which the dataset was created. For example, the first temporary dataset created during a mapping has a qualifier of CTMF000; the second, CTMF001, and so on.

If the space allocation for a dynamic temporary dataset is insufficient, override it with a static allocation in the JCL. Use the following DD statement as a template:

         //SYSTMP<nn> DD DSN=&&TEMP<nn>,
         //              DISP=(NEW,DELETE,DELETE),
         //              DCB=(RECFM=FBS,LRECL=<lrecl>),
         //              UNIT=<unit>,
         //              SPACE=(<space>)

The DDNAME for a statically allocated temporary dataset must use the form, SYSTMPnn, where nn is a number between 01 and 99 corresponding to the sequence number of the temporary dataset. For example, if the third temporary dataset created by a map (the system-generated dataset name with a low-level qualifier of CTMF002) runs out of space (this will be indicated by an IEC030I x37 message in JES log), override the dynamic allocation with a SYSTMP03 DD statement that provides sufficient space.

The dataset name for a static allocation must begin with && which indicates a temporary dataset. The disposition must be (NEW,DELETE,DELETE). The RECFM should be FBS (fixed blocked standard) although F (fixed unblocked) can be used. You can choose the logical record length, although larger record lengths may increase IO efficiency. Do not use the BUFNO parameter.

To statically allocate all the temporary datasets that can possibly be used by a map, code DD statements SYSTMP01 through SYSTMPnn, where nn is equal to 1 + (2 * number of inputs) + (2 * number of outputs). This will provide adequate space.

Note: Statically allocating temporary datasets may increase map performance.

Static temporary dataset allocations are reused when multiple maps are executed from the command line. Consider the following scenario: the command line executes MAPA followed by MAPB and MAPC. MAPA uses seven temporary files, MAPB nine, and MAPC four. In this example, you must statically allocate not 20 temporary datasets (7 + 9 + 4), but nine temporary datasets, the maximum number needed by any map in the series. Each successive map execution reuses the existing static temporary file allocations beginning with SYSTMP01.

The resulting execution log reports complete temporary dataset usage information including DDNAME, dataset name, DCB, and size.