Supplying a procedure when running File Manager in batch

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

The procedure that you use to enhance File Manager processing can either be a member of the PDS allocated to ddname FMNEXEC, 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 FMNEXEC DD statement that specifies the name of the PDS that contains the member.
  2. Code PROC=member-name in the File Manager control statements.

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

//jobcard
//*
//FILEMNGR PROC
//FILEMAN  EXEC PGM=FILEMGR
//STEPLIB  DD  DISP=SHR,DSN=hlq.SFMNMOD1
//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 FMNUSER.EXEC.
//*   Member BATCH of PDS FMNUSER.FMN.CNTL is updated.
//*   The updated member is printed.
//*
//EXAMPLE    EXEC FILEMNGR
//FMNEXEC  DD  DISP=SHR,DSN=FMNUSER.EXEC
//INDD     DD  DISP=SHR,DSN=FMNUSER.FMN.CNTL
//SYSIN    DD  *
$$FILEM DSU INPUT=INDD,MEMBER=BATCH,PROC=EXAMPLE
$$FILEM DSP DSNIN=FMNUSER.FMN.CNTL(BATCH)
/*

To use an inline procedure:

  1. Code PROC=* in the File Manager 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
//*
//FILEMNGR PROC
//FILEMAN  EXEC PGM=FILEMGR
//STEPLIB  DD  DISP=SHR,DSN=hlq.SFMNMOD1
//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 FMNUSER.FMN.CNTL is updated.
//*   The updated member is printed.
//*
//EXAMPLE2    EXEC FILEMNGR
//INDD     DD  DISP=SHR,DSN=FMNUSER.FMN.CNTL
//SYSIN    DD  *
$$FILEM DSU INPUT=INDD,MEMBER=BATCH2,PROC=*
 outrec = change(outrec,'//','??');
/+
$$FILEM DSP DSNIN=FMNUSER.FMN.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.