Invoking Z Data Tools functions from a REXX procedure or CLIST in /BATCH mode

Some functions which do not require user interaction (such as DSC, DSP, DVT, FCH, and SCS) and are otherwise available for JCL batch processing can also be invoked from a REXX program under TSO/ISPF in a pseudo-batch mode.

This mode can be achieved by specifying a /BATCH parameter on Z Data Tools invocation. When specified, it forces batch-type processing while executing under TSO/ISPF.

Before invoking the program you must allocate all the required data sets, including SYSIN and SYSPRINT. By default, report output is written to SYSPRINT. Sections of the output can be directed instead to the following ddnames:

HFMROPT
Z Data Tools active options
HFMRPRM
$$FILEM command parameters and return codes
HFMRPRC
REXX procedure statements read from SYSIN
HFMREPT
Command reports and return codes
HFMRSUM
TALLY summary report

If HFMPRINT is present in the JCL, it is used instead of SYSPRINT. If HFMIN is present in the JCL, it is used instead of SYSIN.

The following shows a sample program invocation from a REXX program using the /BATCH parameter:
/* rexx */
"ALLOC DD(SYSPRINT) NEW LRECL(132) RECFM(F B) DSORG(PS) REUSE SPACE(1 1) CYL"
"ALLOC DD(DDIN) DA('TEST.PDS') SHR REU"
"ALLOC DD(SYSIN) NEW LRECL(80) RECFM(F B) DSORG(PS) REUSE SPACE(1) TRA"
PARM.0 = 3;
PARM.1 = "$$FILEM SET HEADERPG=NO"
PARM.2 = "$$FILEM FCH MEMBER=* INPUT=DDIN "
PARM.3 = "C '12AFSDF' '2ASDFSD'"
"EXECIO * DISKW SYSIN (STEM PARM. FINIS"
"CALL *(HFMMAIN) '/BATCH'"
/* or "HFMMAIN '/BATCH'" */
SAY RC
"EXECIO * DISKR SYSPRINT (STEM SP. FINIS"
DO I = 1 TO SP.0
SAY SP.I
END
"FREE DD(DDIN SYSIN SYSPRINT)"