Running Workload Automation Programming Language as a load module

In addition to running Workload Automation Programming Language as a compiled REXX EXEC, you can also use the load module EQQWAPL.

Because EQQWAPL runs without a TSO environment, the following limitations apply:
  • The MEMBER keyword of OISTART and JSSTART is not available. You can specify the text for these commands only by using the DLM keyword, or the respective OIT or JST statement.
  • The INCLUDE command cannot be used in the format INCLUDE <DDNAME>(<MEMBER>). You can use other formats, for example INCLUDE <DDNAME> and INCLUDE USER_FIELD(<name>).
  • The JCL keyword of ADDJOB is not available.
  • You cannot use the TSO commands BULKDISC, DEFINE, DELETE, JSUACT, and REPRO. You can use the PIF version of DELETE to delete the database and plan objects.
  • You cannot use the DYNLOG and XLATE keywords of OPTIONS.

Apart from the above limitations, the EQQWAPL load module is equivalent to EQQYXTOP. EQQWAPL is provided for scenarios where you want to call Workload Automation Programming Language from other load modules or exits; in all other cases, you can use EQQYXTOP.

To call the load module version from JCL, use the EQQYXJPL procedure. This procedure is similar to EQQYXJPX, but it is set to run the load module instead of a compiled EXEC. Other than the name of the procedure, running Workload Automation Programming Language as a load module is the same as running the EXEC. Within the procedure the differences are:
  • IKJEFT01 is not run to establish a TSO environment.
  • The CMD symbolic points directly to the load module to execute (default EQQWAPL).
  • The SYSPROC and SYSTSPRT DD statements are omitted.
The following example shows a simple Workload Automation Programming Language step to add an application to the plan using the load module version of Workload Automation Programming Language:
//RUNWAPL  EXEC EQQYXJPL,              
//         SUBSYS=WSMC                 
//SYSIN    DD *                        
ADDJOB ADID(ADHOC) 

To call Workload Automation Programming Language from another load module in batch, use the EQQYXJPL procedure. The following example shows the Workload Automation Programming Language step to call Workload Automation Programming Language from another load module. There is no SYSIN DD statement, because the commands are passed to EQQWAPL through a control block.

//RUNWAPL  EXEC EQQYXJPL,                       
//         CMD=MYPROG,
//         SUBSYS=WSMC                          
You can pass commands to EQQWAPL through an ordinary SYSIN, but when EQQWAPL is called by another load module, commands are passed through a control block. Create the WPLI command control block as follows:
Table 1. WPLI command control block
Offset (dec) Offset (hex) Length Type Field Description
00 00 4 Signed WPLILINE Number of 80 byte input lines.
04 04 4 Unsigned WPLIOADR Address of output data block. Must be initialized to zero.
08 08 4 Signed WPLIOSIZ Size of output block. Must be initialized to zero.
12 0C 4 Unsigned WPLIMADR Address of message data block. Must be initialized to zero.
16 10 4 Signed WPLIMSIZ Size of message data block. Must be initialized to zero.
20 14 80xWPLILINE Character WPLICMDS Each line of WAPL commands.

Specify the commands to be passed to Workload Automation Programming Language in the WPLICMDS field. Each line of command text must be long 80 bytes, with normal continuation rules applying; you can use blanks to reach the required 80-byte length. The WPLILINE field must be set to represent the number of 80 byte lines, because it refers to the command text in WPLICMDS. The WPLIOADR, WPLIOSIZ, WPLIMADR, and WPLIMSIZ must be initialized to zero, because they will be set by Workload Automation Programming Language if any data is returned.

The following example shows a control block running the following command statements:
  • OPTIONS STRIP(Y) SHOWDFLT(N)
  • LOADDEF AD* DATA(-) LOADER(*)
  • SELECT AD ADID(DAILYPLANNING)
WPLI:                                                              
    START ADDRESS: 0000CAA0   LENGTH: 0xFC                         
            00112233 44556677 8899AABB CCDDEEFF  -0123456789ABCDEF-
    000000  00000003 00000000 00000000 D6D7E3C9  *... ........OPTI*
    000010  D6D5E240 E2E3D9C9 D74DE85D 40E2C8D6  *ONS STRIP(Y) SHO*
    000020  E6C4C6D3 E34DD55D 40404040 40404040  *WDFLT(N)        *
    000030  40404040 40404040 40404040 40404040  *                *
    000040  40404040 40404040 40404040 40404040  *                *
    000050  40404040 40404040 40404040 D3D6C1C4  *            LOAD*
    000060  C4C5C640 C1C45C40 C4C1E3C1 4D605D40  *DEF AD* DATA(-) *
    000070  D3D6C1C4 C5D94D5C 5D404040 40404040  *LOADER(*)       *
    000080  40404040 40404040 40404040 40404040  *                *
    000090  40404040 40404040 40404040 40404040  *                *
    0000A0  40404040 40404040 40404040 E2C5D3C5  *            SELE*
    0000B0  C3E340C1 C440C1C4 C9C44DC4 C1C9D3E8  *CT AD ADID(DAILY*
    0000C0  D7D3C1D5 D5C9D5C7 5D404040 40404040  *PLANNING)       *
    0000D0  40404040 40404040 40404040 40404040  *                *
    0000E0  40404040 40404040 40404040 40404040  *                *
    0000F0  40404040 40404040 40404040           

If any data is directed to the REXX stack within EQQWAPL, this data is returned to the calling program in a second control block.

After calling EQQWAPL, the calling load module checks the fields WPLIOADR and WPLIOSIZ in the WPLI control block. If these fields are set to a value different from zero, the data has been returned in a second control block WPLO. If messages have been returned, WPLIMADR and WPLIMSIZ are set to a value different from zero, and a second WPLO control block containing messages is created.

The WPLO control block has the following format:
Table 2. WPLO control block format
Offset (dec) Offset (hex) Length Type Field Description
0 0 4 Signed WPLOLINE Number of WAPL output lines.
4 4 Variable * WPLORECS Block of WAPL output records.
Though batch loader data output from Workload Automation Programming Language is set to 80 bytes, ILSON data output can be extremely variable in length, therefore the WPLORECS field is made of a repeating pair of fields that describe the length and text.
Table 3. WPLORECS field content
Offset (dec) Offset (hex) Length Type Field Description
0 0 4 Unsigned WPLRLEN Length of WAPL output record.
4 4 Variable Character WPLRTEXT WAPL output text.

Use WPLIOADR and WPLIOSIZ to get the control block data, then use WPLOLINE to know how many records to retrieve from within the data. The first 4 bytes of WPLORECS (the WPLRLEN field) describes how long the WPLRTEXT field is, and the offset to the next WPLRLEN field. Repeat this process for the number specified in the WPLOLINE field.

To call Workload Automation Programming Language from another load module and use the WPLI control block, you must include a parameter string when you call EQQWAPL. The parameter string must include the subsystem name and an INPUT keyword that includes the address of the WPLI control block. The address must be passed as an 8 byte hex address prefixed with 0x, for example IWSC INPUT(0x0000CAA0).

Before calling EQQWAPL, the storage for the WPLI control block is obtained within the calling program code. The storage for the WPLO control block is obtained automatically during the running of EQQWAPL. After the control is returned to the calling program, the storage for the WPLI and WPLO control blocks is released within the calling program code.