Previous Topic

Next Topic

Book Contents

Book Index

Calling the CTMBLT Utility from another program

The CTMBLT utility can be called from another program. The calling program passes required control statements to the CTMBLT utility using a table residing in memory (rather than from a data set referenced by the DAINPRM DD statement). The CTMBLT utility can also pass back to the calling program replies on the activities it performed.

To call CTMBLT from another program and pass a table of control statements residing in memory to the CTMBLT utility, specify the following parameters in the calling statement:

Note: Except for the cnt parameter, not all the parameters are required. If a parameter is not required, you should specify 0 as the value, unless it is the last parameter in the list, in which case you can omit it.

Table 96 CTMBLT Calling Parameters

Parameter

Description

cnt

Specifies the number of parameters that follow (valid values are 2, 3, and 4). This parameter must be a halfword.

line#

Specifies the number of control statements being passed to the CTMBLT utility. This parameter must be a full word.

This parameter is mandatory if an address of a table residing in memory is also specified, unless an END statement has been included in the table containing the CTMBLT control statements.

taddress

Specifies the address of the table residing in memory. This table contains CTMBLT control statements, and each element in the table must be an 80-byte card image.

altaddress

Specifies the address of the table of alternate ddnames that CTMBLT uses. This table provides alternate ddnames for the following files:

  • DAINPRM
  • DAPRINT
  • DASCHD
  • DATABERR.

This parameter points to a table containing these four 8-byte alternate ddnames, in the order shown. A DD name for which the user does not want to supply an alternate must be left blank. You must use this table when the calling program is already using one of these ddnames.

Note: Do not use DAMSG as an alternate DD name, and do not use DD name LIBOUT as an alternate for DASCHD.

replyaddr

Specifies the address of a parameter list used when requesting replies from CTMBLT and any program that it calls, such as CTMJOB when setting MEM-OVERWRITE to ORDER or FORCE. These replies usually contain information about each table built by CTMBLT, and about jobs ordered by CTMJOB.

The parameter list must be formatted as specified in macro CTMBAPI, which is supplied in the IOA MAC library, as shown in Table 97. The BAPIRPLS and BAPIRPLE parameters must be specified. These parameters indicate the beginning and end (last byte) address of a reply area, which the user must supply. Optionally, the user can specify the BAPICMDA and BAPICMDL parameters instead of the corresponding line# and taddress parameters in the CTMBLT calling list.

Replies from CTMBLT and the programs that it calls are returned to the area addressed by BAPIRPLS. CTMBLT returns as many replies as can be fit in this area, which is determined by BAPIRPLE. The number of replies is returned in BAPIRPL#. The format and size of the each reply slot is mapped by macro CTMBAPO in the IOA MAC library. If the supplied reply area is insufficient to hold all replies, a Reason Code of 286 is placed in BAPIRSN. The final utility return code is placed in BAPIURC.

Table 97 shows the CTMBAPI parameters used when requesting replies from CTMBLT and programs that it calls.

Table 97 CTMBAPI Parameters Used by CTMBLT

Parameter

Description

BAPICMDA

Address of CTMBLT input control statements

BAPICMDL

CTMBLT input control statement buffer length

BAPIRPLE

Address of the end of the reply area mapped by CTMBAPO

BAPIRPLS

Address of reply area slots mapped by CTMBAPO

BAPIRPL#

Number of reply entries returned to CTMBLT

BAPIRC

CTMBAPI return code

BAPIRSN

CTMBAPI reason code

Note: Although there are other CTMBAPI parameters, they are reserved for program use, and should be initialized to binary zero.

For example, in Assembler the following statement format is used:

CALL    CTMBLT,(cnt,line#,taddress,altaddr,replyaddr)

If the CTMBLT utility cannot build a table, a non-zero return code is placed in register 15 (R15) and an error message is written to the file referenced by DD statement DAPRINT.

Parent Topic

CTMBLT – Create Tables