Application programming on z/OS
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


What is a load library?

Application programming on z/OS

A load library contains programs ready to be executed.

A load library can be any of the following:
  • System library
  • Private library
  • Temporary library.

System library

Unless a job or step specifies a private library, the system searches for a program in the system libraries when you code:
//stepname  EXEC  PGM=program-name

The system looks in the libraries for a member with a name or alias that is the same as the specified program-name. The most-used system library is SYS1.LINKLIB, which contains executable programs that have been processed by the linkage editor.

Private library

Each executable, user-written program is a member of a private library. To tell the system that a program is in a private library, the DD statement defining that library can be coded in one of the following ways:
  • With a DD statement with the ddname JOBLIB after the JOB statement, and before the first EXEC statement in the job.
  • If the library is going to be used in only one step, with a DD statement with the ddname STEPLIB in the step.
To execute a program from a private library, code:
//stepname  EXEC  PGM=program-name

When you code JOBLIB or STEPLIB, the system searches for the program to be executed in the library defined by the JOBLIB or STEPLIB DD statement before searching in the system libraries.

If an earlier DD statement in the job defines the program as a member of a private library, refer to that DD statement to execute the program:
//stepname  EXEC  PGM=*.stepname.ddname

Private libraries are particularly useful for programs used too seldom to be needed in a system library. For example, programs that prepare quarterly sales tax reports are good candidates for a private library.

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 private library or a system library.

In Figure 1, the LKED step creates a temporary library called &&LOADMOD on the SYSLMOD DD statement. In the GO step, we refer back to the same temporary data set by coding:
//GO EXEC PGM=*.LKED.SYSLMOD,....
Figure 1. Compile, link-edit, and execute JCL
//USUAL     JOB  A2317P,'COMPLGO'
//ASM       EXEC PGM=IEV90,REGION=256K,                   EXECUTES ASSEMBLER
//          PARM=(OBJECT,NODECK,'LINECOUNT=50')
//SYSPRINT  DD   SYSOUT=*,DCB=BLKSIZE=3509                PRINT THE ASSEMBLY LISTING
//SYSPUNCH  DD   SYSOUT=B                                 PUNCH THE ASSEMBLY LISTING
//SYSLIB    DD   DSNAME=SYS1.MACLIB,DISP=SHR THE MACRO LIBRARY
//SYSUT1    DD   DSNAME=&&SYSUT1,UNIT=SYSDA,              A WORK DATA SET
//          SPACE=(CYL,(10,1))
//SYSLIN    DD   DSNAME=&&OBJECT,UNIT=SYSDA,              THE OUTPUT OBJECT DECK
//          SPACE=(TRK,(10,2)),DCB=BLKSIZE=3120,DISP=(,PASS)
//SYSIN     DD    *                                       inline SOURCE CODE
                                           .
                                           .
                                           code
                                           .
/*
//LKED      EXEC PGM=HEWL,                                 EXECUTES LINKAGE EDITOR
//          PARM='XREF,LIST,LET',COND=(8,LE,ASM)
//SYSPRINT  DD   SYSOUT=*                                  LINKEDIT MAP PRINTOUT
//SYSLIN    DD   DSNAME=&&OBJECT,DISP=(OLD,DELETE)         INPUT OBJECT DECK
//SYSUT1    DD   DSNAME=&&SYSUT1,UNIT=SYSDA,               A WORK DATA SET
//          SPACE=(CYL,(10,1))
//SYSLMOD   DD   DSNAME=&&LOADMOD,UNIT=SYSDA,              THE OUTPUT LOAD MODULE
//          DISP=(MOD,PASS),SPACE=(1024,(50,20,1))
//GO        EXEC PGM=*.LKED.SYSLMOD,TIME=(,30),            EXECUTES THE PROGRAM
//          COND=((8,LE,ASM),(8,LE,LKED))
//SYSUDUMP  DD   SYSOUT=*                                  IF FAILS, DUMP LISTING
//SYSPRINT  DD   SYSOUT=*,                                 OUTPUT LISTING
//          DCB=(RECFM=FBA,LRECL=121)
//OUTPUT    DD   SYSOUT=A,                                 PROGRAM DATA OUTPUT
//          DCB=(LRECL=100,BLKSIZE=3000,RECFM=FBA)
//INPUT     DD    *                                        PROGRAM DATA INPUT
                 .
                 .
                 data
                 .
/*
//




Copyright IBM Corporation 1990, 2010