Using STEPLIB and TASKLIB with z/OS translators

There are several factors you must consider when you want to have a translator use an additional specific load library similar to the way you use a STEPLIB DD statement in z/OS® JCL.
In JCL, you use the STEPLIB DD statement to specify a step library, which applies only to the job step where the STEPLIB DD is specified; however, you should not specify a STEPLIB DD in a z/OS translator whose call method is set to called program as STEPLIB DD does not work the same way it does in JCL. The reasons are as follows:
  1. z/OS® Ant builds run in a z/OS UNIX subsystem, where you specify STEPLIB through the STEPLIB environment variable.
  2. You cannot change the STEPLIB environment variable in a single z/OS Ant build.
To specify one or more libraries that apply to only one z/OS translator, use TASKLIB DD instead of STEPLIB DD. The following is a description of how TASKLIB DD works z/OS Ant builds:
When you set a translator call method to called program, the z/OS Ant build invokes the translator that, in turn, invokes the program specified in that translator by the ATTACHX assembler macro. The TASKLIB DD is set up based on the following rules:
  • If the translator contains the TASKLIB DD concatenation or allocation, it is used for allocating a TASKLIB DD. If you defined a data set name in the called program data set for the compiler it is ignored.
  • If the translator does not contain the TASKLIB DD concatenation or allocation, the data set name you defined in the called program data set definition is used for allocating a TASKLIB DD.
  • If a STEPLIB environment variable is specified in startbfa.sh then the data sets allocated to that STEPLIB environment variable are concatenated to the TASKLIB allocation. This is because if TASKLIB is active, then the STEPLIB environment variable is ignored by MVS.
  • If there is no TASKLIB DD specified in the translator, and there is no data set name in the called program data set definition for the compiler, then no TASKLIB allocation is possible. In this case the STEPLIB environment variable is used, if specified, along with whatever data sets are defined in the LINKLIST.
If program MODULE1, which is stored in the library HLQ.DATASET1, needs another library HLQ.DATASET2 so it can run, perform the following steps to use TASKLIB:
  1. Create the MODULE1 data set definition. Specify HLQ.DATASET1 as the data set name and MODULE1 as the member name.
  2. Create the HLQ.DATASET1 data set definition. Specify HLQ.DATASET1 as the data set name and do not specify a member name.
  3. Create the HLQ.DATASET2 data set definition. Specify HLQ.DATASET2 as the data set name and do not specify a member name.
  4. Create the MODULE1 translator. Specify the MODULE1 data set definition as the data set definition for a called program.
  5. Create the TASKLIB DD concatenation and add the HLQ.DATASET1 and HLQ.DATASET2 data set definitions to it.
With those definitions, the MODULE1 translator runs with TASKLIB="HLQ.DATASET1:HLQ.DATASET2." MODULE1 is stored in HLQ.DATASET1, and other required modules are stored in HLQ.DATASET2. Unlike the STEPLIB environment variable, TASKLIB is used only for the MODULE1 translator. You can also define other TASKLIB statements for other translators.

video icon Video

Jazz.net channel
Software Education channel

learn icon Courses

IoT Academy
Skills Gateway

ask icon Community

Jazz.net
Jazz.net forums
Jazz.net library

support icon Support

IBM Support Community
Deployment wiki