Temporary library

Temporary libraries are partitioned data sets created to store a program until it is used in a later step of the same job. A temporary library is created and deleted within a job.

When testing a newly written program, a temporary library is particularly useful for storing the load module from the linkage editor until it is executed by a later job step. Because the module will not be needed by other jobs until it is fully tested, it should not be stored in a system library.

While the system assigns the module a name in the temporary library, the name cannot be predicted. Therefore, use the PGM parameter to identify the program by location rather than by name. Code a backward reference to the DD statement that defines the temporary library:
   //stepname  EXEC  PGM=*.stepname.ddname

Creating a temporary library

In the step that produces the program, code a DD statement that creates a partitioned data set and place the program in it. A later step can then retrieve this program. Alternatively, you can use the virtual I/O (VIO) facilities to define a temporary library. See Allocation of virtual I/O for details.

Example

//STEP2    EXEC PGM=IEWL
            .
            .
            .
//SYSLMOD  DD   DSNAME=&&PARTDS(PROG),UNIT=SYSDA,
//           DISP=(NEW,PASS),SPACE=(1024,(50,20,1))
//STEP3    EXEC PGM=*.STEP2.SYSLMOD  

STEP2 calls the program IEWL, which link edits object modules to form a load module that can be executed. STEP2 places the module in the library defined in the SYSLMOD DD statement.

STEP3 calls the program by naming the step that created the library and the DD statement that defines the program as a member of a library. If STEP2 had called a procedure and the DD statement named SYSLMOD was included in PROCSTEP3 of the procedure, you would code PGM=*.STEP2.PROCSTEP3.SYSLMOD.