Building z/OS batch applications

 

To build an application for WebSphere MQ for z/OS that runs under z/OS batch, create job control language (JCL) that performs these tasks:

  1. Compile (or assemble) the program to produce object code. The JCL for your compilation must include SYSLIB statements that make the product data definition files available to the compiler. The data definitions are supplied in the following WebSphere MQ for z/OS libraries:

    • For COBOL, thlqual.SCSQCOBC

    • For assembler language, thlqual.SCSQMACS

    • For C, thlqual.SCSQC370

    • For PL/I, thlqual.SCSQPLIC

  2. For a C application, prelink the object code created in step 1.

  3. Link-edit the object code created in step 1 (or step 2 for a C application) to produce a load module. When you link-edit the code, include one of the WebSphere MQ for z/OS batch stub programs (CSQBSTUB or one of the RRS stub programs: CSQBRRSI or CSQBRSTB).

    CSQBSTUB

    single-phase commit provided by WebSphere MQ for z/OS

    CSQBRRSI

    two-phase commit provided by RRS using the MQI

    CSQBRSTB

    two-phase commit provided by RRS directly

    If you use CSQBRSTB, also link-edit your application with ATRSCSS from SYS1.CSSLIB. Figure 1 and Figure 2 show fragments of JCL to do this. The stubs are language-independent and are supplied in library thlqual.SCSQLOAD.

  4. Store the load module in an application load library.

Figure 1. Fragments of JCL to link-edit the object module in the batch environment, using single-phase commit
⋮
//*
//* WEBSPHERE MQ FOR Z/OS LIBRARY CONTAINING BATCH STUB
//*
//CSQSTUB   DD  DSN=++HLQ.MQM100++.SCSQLOAD,DISP=SHR
//*
⋮
//SYSIN     DD *
  INCLUDE CSQSTUB(CSQBSTUB)
⋮
/*
Figure 2. Fragments of JCL to link-edit the object module in the batch environment, using two-phase commit
⋮
//*
//* WEBSPHERE MQ FOR Z/OS LIBRARY CONTAINING BATCH STUB
//*
//CSQSTUB   DD  DSN=++HLQ.MQM100++.SCSQLOAD,DISP=SHR
//CSSLIB    DD  DSN=SYS1.CSSLIB,DISP=SHR
//*
⋮
//SYSIN     DD *
  INCLUDE CSQSTUB(CSQBRSTB)
  INCLUDE CSSLIB(ATRSCSS)
⋮
/*

To run a batch or RRS program, include the libraries thlqual.SCSQAUTH and thlqual.SCSQLOAD in the STEPLIB or JOBLIB data set concatenation.

To run a TSO program, include the libraries thlqual.SCSQAUTH and thlqual.SCSQLOAD in the STEPLIB used by the TSO session.

To run an OpenEdition batch program from the OpenEdition shell, add the libraries thlqual.SCSQAUTH and thlqual.SCSQLOAD to the STEPLIB specification in your $HOME⁄.profile like this:

  STEPLIB=thlqual.SCSQAUTH:thlqual.SCSQLOAD
  export STEPLIB

 

Parent topic:

Preparing your program to run


fg16780_