Programs can also be generated using batch JCL. The batch JCL executes TSO (IKJEFT01) and issues the ISPSTART command to run the main program named RAAMAIN under ISPF. The input query, query and form, or procedure are passed as parameters into RAAMAIN as shown in the example below.
The option settings usually displayed and set on the Program Generator panels will be obtained from the ISPF profile data set allocated to the ISPPROF DD. Generating programs in batch is like generating programs using the short dialog. Once the input query and form are specified, the program is generated, compiled, and run according to the default settings.
Values for variables that are usually specified on the Edit Variables panel are supplied in the DD named RAAVARS. Each line of this file should be of the form:
&VARNAME=VARVALUE
where &VARNAME is the name of the variable and VARVALUE is the value to supply for that variable. Do not insert spaces on either side of the equal sign (=). The RAAVARS file should be sorted alphabetically. Any variables for which values are not supplied will use the default value.
The following JCL sample will generate a program from a query named QUERY1 and a form named FORM1. The first parameter passed to RAAMAIN is CO. This tells RAAMAIN to run Program Generator. This JCL contains values for two variables in the RAAVARS DD, &VAR1 and &VAR2. This JCL also allocates the necessary DDs for QMF and DB2. Because the facility may have to start QMF and export objects, the QMF and DB2 libraries must be allocated appropriately.
//QMFHPOC EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=2M //SYSTSIN DD * ISPSTART PGM(RAAMAIN) NEWAPPL(RAAX) + PARM(CO =BATCH =QUERY=QUERY1 =FORM=FORM1) /* //RAAVARS DD * &VAR1=20 &VAR2=:HOSTVAR1 SMALLINT /* //SYSTSPRT DD SYSOUT=* //STEPLIB DD DSN=QMFHPO.SRAALOAD,DISP=SHR // DD DSN=QMF.SDSQEXIT,DISP=SHR // DD DSN=QMF.SDSQLOAD,DISP=SHR // DD DSN=DSN.SDSNLOAD,DISP=SHR //SYSPROC DD DSN=QMFHPO.SRAACLST,DISP=SHR // DD DSN=QMFHPO.SRAAEXEC,DISP=SHR // DD DSN=QMF.SDSQCLTE,DISP=SHR // DD DSN=DSN.SDSNCLST,DISP=SHR //SYSEXEC DD DSN=QMFHPO.SRAAEXEC,DISP=SHR // DD DSN=QMF.SDSQEXCE,DISP=SHR //ISPLOG DD SYSOUT=*, // DCB=(LRECL=133,RECFM=VBA,BLKSIZE=137) //ISPPROF DD DSN=USER.ISPF.ISPPROF,DISP=SHR //ISPMLIB DD DSN=QMFHPO.SRAAISPM,DISP=SHR // DD DSN=QMF.SDSQMLBE,DISP=SH // DD DSN=DSN.SDSNSPFM,DISP=SHR //ISPPLIB DD DSN=QMFHPO.SRAAISPP,DISP=SHR // DD DSN=QMF.SDSQPLBE,DISP=SHR // DD DSN=DSN.SDSNSPFP,DISP=SHR //ISPTLIB DD DSN=QMF.SDSQTLBE,DISP=SHR //DSQDEBUG DD SYSOUT=*, // DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100) //RAADEBUG DD SYSOUT=*, // DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100) //ADMGGMAP DD DSN=QMF.DSQMAPE,DISP=SHR