JCL syntax for File Manager batch jobs
To use a File Manager function in a batch job, include the
following statement: //stepname EXEC PGM=FILEMGR
By default, report output is written to SYSPRINT. Sections of the output can be directed instead to the following ddnames:
- FMNROPT
- File Manager active options
- FMNRPRM
- $$FILEM command parameters and return codes
- FMNRPRC
- REXX procedure statements read from SYSIN
- FMNREPT
- Command reports and return codes
- FMNRSUM
- TALLY summary report
If FMNPRINT is present in the JCL, it is used instead of SYSPRINT. If FMNIN 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 File Manager functions the batch job contains.
- 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.
$$FILEM DSNIN='u/test/this is a regular HFS file ',
$$FILEM 'that has a v',
$$FILEM 'ery long name'
- If the control statement contains only the function name, there must be a space between the function name and the comma.
- 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).
- To change processing options in batch or to reset options to the installation default, use the SET function.
Example
//jobcard
//ABC EXEC PGM=FILEMGR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
$$FILEM DSP DSNIN='FMNUSER.TEST.KSDS1',
$$FILEM FORMAT=HEX,KEY=000100,NLRECS=20
/*