JCL syntax for Z Data Tools batch jobs

To use a Z Data Tools function in a batch job, include the following statement: //stepname EXEC PGM=HFMMAIN

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
HFMMLST
Alternative method to $$FILEM parameter
HFMMLST DD provides an alternative method to the $$FILEM parameter MEMLIST or CPYMBR (DSC) for specifying the members to be used as input to the following Z Data Tools functions:
Figure 1. Syntax

1 + , MEMBER
1 C'-lowcase_mem'
1 X'-hex_memname'
1 +  ( MEMBER(1) )
1 C'-lowcase_mem'
1 X'-hex_memname'
Notes:
  • Member names containing lowercase or unprintable characters:
    • Member names specified with the CPYMBR, MEMBER, MEMSTART, MEMEND, or MEMOUT keywords may contain lowercase or unprintable characters.
    • To specify a member name containing lowercase or mixed case characters, use the character literal form of the name surrounded by quotation marks and preceded with character C. For example, C'aBc'.
    • To specify a member name containing unprintable characters, use the hexadecimal literal form of the name surrounded by quotation marks and preceded with character X. For example, X'81C283'. Mask characters (their hexadecimal value) may be included within the string.

The examples below are specifying the members in HFMMLST.

MEMBER1                                                 Single member name
MEMBER1, MEMBER2                                          Multiple members per line
MEMBER1 (NEWMEMX), MEMBER2 (NEWMWMY)                      DSC multiple members being renamed
C'MEMlower                                                Member contains lower case character
X'D4C4D40000'                                             Member contains non displayable characters

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.

You might also need a STEPLIB statement or other DD statements, depending on which Z Data Tools functions the batch job contains.

When you code Z Data Tools control statements, you must:
  • Begin each control statement with $$FILEM in columns 1 to 7, followed by a blank in column 8, followed by the command name, followed by the first parameter (if any).
  • Specify parameters and their values separated by an equal sign, as follows:
    PARAMETER=value
  • Follow each parameter (except the last one) immediately with a comma.

Comment statements, which begin with an asterisk (*), are also allowed.

To continue a control statement onto the next line, end the first line with a comma and begin the next line with $$FILEM and a blank.

To continue a parameter that does not fit onto one line, do not use a continuation character. Instead, split the parameter into more than one line, enclosing each part in apostrophes. For example:
$$FILEM DSNIN='u/test/this is a regular HFS file ',
$$FILEM 'that has a v',
$$FILEM 'ery long name'
Notes:
  1. If the control statement contains only the function name, there must be a space between the function name and the comma.
  2. To continue FIND and CHANGE commands in the FCH (Find/Change) utility, end the first line with a comma (the continuation line does not contain $$FILEM).
  3. To change processing options in batch or to reset options to the installation default, use the SET function.
In HEX format, the following example shows a batch job that uses the DSP Z Data Tools function to print 20 records of a data set (starting at the record with key value 0001000):
//jobcard
//ABC EXEC PGM=HFMMAIN
//SYSPRINT DD SYSOUT=*
//SYSIN  DD *
$$FILEM DSP DSNIN='HFMUSER.TEST.KSDS1',
$$FILEM FORMAT=HEX,KEY=000100,NLRECS=20
/*