Supplying a procedure when running Z Data Tools in batch

If you are using one of the Z Data Tools functions that supports enhanced processing, then you use the PROC parameter to supply the procedure.

The procedure that you use to enhance Z Data Tools processing can either be a member of the PDS allocated to ddname HFMEXEC, or it can be coded in-line (by specifying an asterisk as the procedure name).

To use a procedure stored in a member of a PDS:

  1. Code an HFMEXEC DD statement that specifies the name of the PDS that contains the member.
  2. Code PROC=member-name in the Z Data Tools control statements.

For example, to use the REXX procedure stored in HFMUSER.EXEC(EXAMPLE):

//jobcard
//*
//ZDTOOLS  PROC
//ZDT      EXEC PGM=HFMMAIN
//STEPLIB  DD  DISP=SHR,DSN=hlq.SHFMMOD1
//SYSPRINT DD  SYSOUT=*
//SYSABEND DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//         PEND
//*
//*   Run DSU function with an existing REXX procedure.
//*   The REXX procedure used is in member EXAMPLE in HFMUSER.EXEC.
//*   Member BATCH of PDS HFMUSER.HFM.CNTL is updated.
//*   The updated member is printed.
//*
//EXAMPLE    EXEC ZDTOOLS 
//HFMEXEC  DD  DISP=SHR,DSN=HFMUSER.EXEC
//INDD     DD  DISP=SHR,DSN=HFMUSER.HFM.CNTL
//SYSIN    DD  *
$$FILEM DSU INPUT=INDD,MEMBER=BATCH,PROC=EXAMPLE
$$FILEM DSP DSNIN=HFMUSER.HFM.CNTL(BATCH)
/*

To use an inline procedure:

  1. Code PROC=* in the Z Data Tools control statements.
  2. Code your DFSORT or REXX statements in the SYSIN data stream, following the PROC=* statement.
  3. Terminate the DFSORT or REXX statements with a line containing a slash and a plus sign (/+) in columns 1–2.

For example:

//jobcard
//*
//ZDTOOLS  PROC
//ZDT      EXEC PGM=HFMMAIN
//STEPLIB  DD  DISP=SHR,DSN=hlq.SHFMMOD1
//SYSPRINT DD  SYSOUT=*
//SYSABEND DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//         PEND
//*
//*   Run DSU function with a REXX EXEC specified as an in-line proc.
//*   Member BATCH2 of PDS HFMUSER.HFM.CNTL is updated.
//*   The updated member is printed.
//*
//EXAMPLE2    EXEC ZDTOOLS 
//INDD     DD  DISP=SHR,DSN=HFMUSER.HFM.CNTL
//SYSIN    DD  *
$$FILEM DSU INPUT=INDD,MEMBER=BATCH2,PROC=*
 outrec = change(outrec,'//','??');
/+
$$FILEM DSP DSNIN=HFMUSER.HFM.CNTL(BATCH2)
/*

When coding an inline procedure, do not begin comments in column 1; if you do, the /* is interpreted as an end-of-data delimiter.