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


Program management loader

Application programming on z/OS

The program management loader increases the services of the program manager component by adding support for loading program objects. The loader reads both program objects and load modules into virtual storage and prepares them for execution. It resolves any address constants in the program to point to the appropriate areas in virtual storage and supports the 24-bit, 31-bit and 64-bit addressing modes.

In processing object and load modules, the linkage editor assigns consecutive relative virtual storage addresses to control sections and resolves references between control sections. Object decks produced by several different language translators can be used to form one load module.

In Figure 1 we have a compile, link-edit, and execute job, in this case for an assembler program.

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
                 .
/*
//
Notes:
  • In the step ASM (compile), SYSIN DD is for the inline source code and SYSLIN DD is for the output object deck.
  • In the step LKED (linkage-edition), the SYSLIN DD is for the input object deck and the SYSLMOD DD is for the output load module.
  • In the step GO (execute the program), the EXEC JCL statement states that it will execute a program identified in the SYSLMOD DD statement of the previous step.
  • This example does not use a cataloged procedure, as the COBOL examples did; instead, all of the JCL has been coded inline. We could have used an existing JCL procedure, or coded one and then only supplied the overrides, such as the INPUT DD statement.




Copyright IBM Corporation 1990, 2010