Running QMF batch in native z/OS
In addition to running QMF batch in TSO and ISPF, you can run QMF as a native z/OS® batch job.
You can use JCL like the following example.
/***************************************************************/ 00299000
//QMFBAT JOB 00300000
//S1 EXEC PGM=DSQQMFE,PARM='M=B,I=yourQMFproc' 00301000
//* 00302000
//* Program libraries required when running in batch 00303000
//* 00304000
//STEPLIB DD DSN=QMF1310.SDSQLOAD,DISP=SHR 00305000
// DD DSN=DSN1110.SDSNEXIT,DISP=SHR 00306000
// DD DSN=DSN1110.SDSNLOAD,DISP=SHR 00307000
// DD DSN=GDDM.ADMLOAD,DISP=SHR 00308000
//* 00309000
//* QMF/GDDM maps are required when running in batch 00310000
//* 00311000
//ADMGGMAP DD DSN=QMF1310.SDSQMAPE,DISP=SHR 00312000
//* 00313000
//* 00314000
//* Data sets used by QMF 00315000
//* 00316000
//DSQPRINT DD SYSOUT=A,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=1330) 00317000
//DSQDEBUG DD SYSOUT=A,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=1310) 00318000
//DSQUDUMP DD SYSOUT=A,DCB=(RECFM=VBA,LRECL=125,BLKSIZE=1632) 00319000
//DSQSPILL DD DSN=&&SPILL,DISP=(NEW,DELETE), 00320000
// UNIT=SYSDA,SPACE=(TRK,(100),RLSE), 00321000
// DCB=(RECFM=F,LRECL=4096,BLKSIZE=4096) 00322000
//* 00323000
/****************************************************************/ 00324000
When you run QMF in native z/OS, remember that:
- TSO is not available.
- QMF functions that require TSO or ISPF do not work when you run QMF in native z/OS.
- The default user ID suffix is not available; you must use the fully qualified data set names to export or import files.
- You cannot use procedures with logic (REXX procedures). To run QMF with REXX in a non-TSO address space, you must use IRXJCL, as illustrated in Figure 2.
The REXX program that is listed here uses the QMF callable interface to start QMF and run QMF commands in batch mode.
//QMFBATCH JOB REGION=8M,
// MSGCLASS=H,TIME=(2,30),USER=&SYSUID,NOTIFY=&SYSUID,CLASS=A
//ROBQMF1 EXEC PGM=IRXJCL
//STEPLIB DD DSN=DSN1110.DB2A.SDSNLOAD,DISP=SHR
// DD DSN=DSN1110.DB2A.SDSNEXIT,DISP=SHR
// DD DSN=QMFDEV.QMF1310.SDSQLOAD,DISP=SHR
//ADMGGMAP DD DSN=QMFDEV.QMF1310.SDSQMAPE,DISP=SHR
//SYSEXEC DD DSN=ROBIN.QMF1310.SDSQEXCE,DISP=SHR
//DSQPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=137,BLKSIZE=1330)
//DSQDEBUG DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=1310)
//DSQUDUMP DD SYSOUT=A,DCB=(RECFM=VBA,LRECL=125,BLKSIZE=1632)
//SYSUDUMP DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//DSQSPILL DD DSN=&&SPILL,DISP=(NEW,DELETE),
// UNIT=VIO,SPACE=(CYL,(10,20),RLSE),
// DCB=(RECFM=F,LRECL=4096,BLKSIZE=4096)
//SYSTSIN DD *
/* REXX */
CALL DSQCIX "START (DSQSMODE=BATCH"
SAY DSQ_MESSAGE_ID DSQ_MESSAGE_TEXT
IF DSQ_RETURN_CODE = DSQ_SEVERE THEN EXIT DSQ_RETURN_CODE
CALL DSQCIX "RUN PROC REXXPP"
SAY DSQ_MESSAGE_ID DSQ_MESSAGE_TEXT
CALL DSQCIX "EXIT"
SAY DSQ_MESSAGE_ID DSQ_MESSAGE_TEXT
EXIT DSQ_RETURN_CODE
/*
These JCL samples allocate a spill file. Instead of allocating a file for spill data, you can use the DSQSPTYP parameter to spill data to extended storage.
When running a QMF procedure with logic or REXX exec in QMF batch mode, ensure to exit the exec with the REXX EXIT statement by specifying the proper return code. You must perform this step to pass the correct return code to the batch job step. If you do not use the EXIT statement with the proper return code, the batch job might indicate the wrong return code. For example, an error might occur in the QMF procedure with logic that is not indicated in the batch job return code. For more information, see Messages with the REXX EXIT statement and Branching to error-handling subroutines.