Building z/OS batch applications
Learn how to build z/OS batch applications and the steps to consider when doing so.
To build an application for IBM MQ for z/OS that runs under z/OS batch, create job control language (JCL) that performs these tasks:- Compile (or assemble) the program to produce object code. The JCL for the
compilation must include SYSLIB statements that make the product data definition files available to
the compiler. The data definitions are supplied in the following IBM MQ for z/OS libraries:
- For COBOL, thlqual.SCSQCOBC
- For assembler language, thlqual.SCSQMACS
- For C, thlqual.SCSQC370
- For PL/I, thlqual.SCSQPLIC
- For a C application, prelink the object code created in step 1.
- For PL/I applications, use the compiler option EXTRN(SHORT).
- 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, we must include one of the IBM MQ for z/OS batch stub programs (CSQBSTUB or one of the RRS stub programs: CSQBRRSI or CSQBRSTB).
- CSQBSTUB
- single-phase commit provided by IBM MQ for z/OS
- CSQBRRSI
- two-phase commit provided by RRS using the MQI
- CSQBRSTB
- two-phase commit provided by RRS directly
Notes:
- If we use CSQBRSTB, we must also link-edit the 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.
- If the application runs under Language Environment, we should ensure you link-edit with the Language Environment DLL instead as described in Building z/OS batch applications using Language Environment.
- Store the load module in an application load library.
To run a batch or RRS program, we must include the libraries thlqual.SCSQAUTH and thlqual.SCSQLOAD in the STEPLIB or JOBLIB data set concatenation.
To run a TSO program, we must include the libraries thlqual.SCSQAUTH and thlqual.SCSQLOAD in the STEPLIB used by the TSO session.
To run a UNIX System Services batch program from the UNIX System Services 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 STEPLIBParent topic: Preparing your program to run