INCLUDE – Include code from other data sets or members to be run

Use the INCLUDE statement to include Workload Automation Programming Language statements from other data sets or members in the Workload Automation Programming Language command stream. With this command, you can also access user fields belonging to the operation that controls the job to use their values as SYSIN.

INCLUDE ddname-1(member-1,member-2,...,member-n) ddname-2,...,ddname-n

or

INCLUDE USER_FIELD(mask)

The statements can be read from DD statements allocated to the step running Workload Automation Programming Language.

In a single INCLUDE statement you can include multiple members from one DD statement and multiple DD statements. Workload Automation Programming Language reads and runs the statements in the order specified.

You can specify a DD statement without a member name if the DD statement is allocated to a sequential file, a partitioned data set with a member name specified, or a concatenation of both.

You can specify a DD statement with a member name if the DD statement is allocated to either a single partitioned data set without a member name specified, or a concatenation of partitioned data sets. You can also INCLUDE a member name when the DD statement is allocated to a partitioned data set with a different member allocated. If you specify a member when either the partitioned data set has no member name specified at allocation, or the member name allocated is different from the one requested, Workload Automation Programming Language allocates the partitioned data set, in which the member is found, temporarily to DD statements EQQTEMP to allow the content to be read.

Note:
  • To search for a member name, Workload Automation Programming Language requires that all files in the concatenation are cataloged. If you want to INCLUDE a member from an uncataloged data set, you must allocate the member explicitly in the Workload Automation Programming Language step.
  • If you use the INCLUDE statement with the EQQWAPL load module, you cannot specify member names. You can set only DD statements and user fields.
In the following example, you load the in-built OUTPUT definitions ADCOM and ADRUN. You have activated variable substitution and set two variables that will be referenced in Batch Loader contained within the skeletons in members DAILY and WEEKLY of the MYSKELS file:
//WAPLSTEP EXEC EQQYXJPX,
//         SUBSYS=IWSA
//MYSKELS DD DISP=SHR,DSN=MY.SKELS.LIB
//OUTDATA DD SYSOUT=*,LRECL=4096
//OUTBL DD SYSOUT=*
//SYSIN DD *
LOADDEF ADCOM
LOADDEF ADRUN
LIST ADCOM ADID(MYAPPLS*) SELECT(Y)
VARSUB SCAN
VARSET LOB=PY
VARSET PHASE=P
INCLUDE MYSKELS(DAILY,WEEKLY)

By default, the contents of any statements loaded by an INCLUDE statement are run at MSGLEVEL(3), in the same way as whatever is included by being referenced by the FILESPEC symbolic parameter. This means that ordinarily if you use an INCLUDE statement the content is not displayed in the SYSTSPRT output of Workload Automation Programming Language, unless a command fails.

User fields can be included by using a special DD name of USER_FIELD. The member name is the name of an individual User Field, or it can be a mask, using the wildcard characters percent sign (%) and asterisk (*) to include values from many matching user fields.

The comparison with the field name is not case sensitive, and each field is used in alphabetical order.