If you generate a program that uses the TSO attachment facility, it must be run under the DSN command processor of TSO. If you generate a program that uses the call attachment facility or the RRS attachment, you can run the program.
If you use a method other than the Run Programs option to run programs (for example, by creating your own batch JCL), the following requirements must be observed:
REPORT01:The primary report is written to the DD named REPORT01. RECFM should be set to FBA, because the first character of each record that is written to this DD is reserved for carriage control. For standalone programs, the LRECL must equal the LRECL specified in the program. For HPO/Runtime programs, any LRECL may be specified. A typical DD declaration is:
//REPORT01 DD SYSOUT=*, // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=1330)
REPORTnn: If the report horizontally spans multiple pages, then these additional pages are written to a series of DDs named REPORT02, REPORT03, and so on. Up to 99 of these subpages are supported. A typical DD declaration is:
//REPORT02 DD SYSOUT=*, // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=1330) //REPORT03 DD SYSOUT=*, // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=1330)
In an HPO/Runtime program, you can control the width of a report page two different ways:
For example, if you set the PAGE-WIDTH variable to 132, then no more than 132 characters of report data will appear on each line of the report. One additional character will be included in each report row to handle carriage control. In the previous example, even though the page width is set to 132, there will actually be 133 characters written to the report file.
For example, if you set LRECL=133, then at most 133 characters will appear on each record of the report file (132 characters of report data and one character of carriage control).
These settings are taken into account when calculating the width of a report page and determining whether to split a report row across multiple pages:
report page width = minimum(page width variable value, LRECL - 1).
The LRECL is obtained from the REPORT01 DD. If you have more than one REPORTnn DD defined in your JCL, make sure that they all have the same LRECL value.
HOSTVARS: This DD is used to pass runtime host variable values to batch report programs. The LRECL must match the LRECL specified when the program was generated. If the program was generated to use a tabular host variable format, each record in this file must contain a complete set of host variable values for the program. Each value must be separated by the delimiter character specified when the program was generated. If the program was generated to use a columnar host variable format, each record in this file will contain only one host variable value.
The order of values must match (in order and type) the host variables as defined in the program. Host variables are defined in alphabetical order in the program. If there is any mismatch in data types, a runtime error will cause the program to exit.
This file will be read repeatedly and a report will be generated for each complete set of host variable values read. If an incomplete set of values is read, the program will terminate with an error.
A typical DD declaration (for non-tabular host variables) is:
//HOSTVARS DD * host variable value 1 . . . host variable value n /*
PROCVARS: Proc programs that run batch report programs that use host variables use the PROCVARS DD as described for the HOSTVARS DD above. The host variable values for each of the report programs run should be listed in the PROCVARS DD in sequence. These programs also need the HOSTVARS DD defined as a temporary file. A typical DD declaration (for non-tabular host variables) is:
//PROCVARS DD * program 1 host variable value 1 . . . program 1 host variable value n program 2 host variable value 1 . . . program 2 host variable value n /* //HOSTVARS DD UNIT=SYSDA,SPACE=(TRK,(1,1))
DATAOUT: If you generate a program that writes data to a sequential file, the DD that is opened for output is named DATAOUT. The only DCB parameter that must be in sync with the program is the LRECL. The length of the output record must exactly match the LRECL of the data set assigned to this DD. A typical DD declaration is:
//DATAOUT DD DSN=data.set.name,DISP=disp
DATAIN: If you generate a program that reads data from a sequential file, the DD that is opened for input is named DATAIN. The only DCB parameter that must be in sync with the program is the LRECL. The length of the output record must exactly match the LRECL of the data set assigned to this DD. A typical DD declaration is:
//DATAIN DD DSN=data.set.name,DISP=disp
RAASPILL: When an HPO/Runtime program that uses a spill file runs, it uses a DD named RAASPILL for the spill file. This DD should be defined as a temporary file. This DD is not used by standalone programs. A typical DD declaration is:
//RAASPILL DD UNIT=SYSDA,SPACE=(CYL,(50,50))
SYSEXEC: When an HPO/Runtime program that makes use of QMF's FORM.CALC or FORM.COND features runs, it repeatedly evaluates a REXX EXEC named RAARCXPR, which is in QMFHPO.SRAAEXEC. The DD named SYSEXEC is searched for this EXEC at runtime, so SYSEXEC must be allocated to QMFHPO.SRAAEXEC. A typical DD declaration is:
//SYSEXEC DD DSN=QMFHPO.SRAAEXEC,DISP=SHR
STEPLIB: If the program to be run is an HPO/Runtime program, your JCL must allocate QMFHPO.SRAALOAD in JOBLIB or STEPLIB. This is not required for standalone programs.
In addition, you may have to include the DB2 load library and sort load library if they are not included in your site's link list. This is true of both HPO/Runtime programs and standalone programs.
For programs using the call attachment facility or RRS attachment facility, default values for the DB2 subsystem ID and the plan name are generated in the program source code. You can override these settings at runtime by passing parameters on the EXEC card. Here is an example:
//GO EXEC PGM=QUERY1,PARM='DSN,QUERY2'
The following is an example of how to specify only the DB2 subsystem ID and not the plan name:
//GO EXEC PGM=QUERY1,PARM='DSN'
Programs that include SAVE DATA processing where the Action parameter specified was P (prompt), a positional parameter can be specified to indicate the desired disposition of data existing in the SAVE DATA table, with a value of R to indicate that this data should be replaced, or A to indicate that this data should be retained (and appended).
For programs using the call attachment facility or the RRS attachment facility, this parameter follows the parameters described above:
//GO EXEC PGM=QUERY1,PARM='DSN,QUERY2,R'
Otherwise, it appears first in the PARM field:
//GO EXEC PGM=QUERY1,PARM='R'