Supplying a procedure when invoking File Manager from a REXX program

You can specify a PROC parameter to enhance File Manager processing even when you are invoking the File Manager function from a REXX program.

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

  1. Allocate an FMNEXEC DD that identifies a PDS where your saved procedures reside.
  2. Code PROC=member-name in the File Manager function invocation.

For example, to use the procedure stored in USERID.FMNEXEC(TOTALS):

/* REXX program to print a data set, with enhanced processing */
/* as defined in the "nested" REXX procedure named TOTALS     */
"ALLOC DD(FMNEXEC) DSN('USERID.FMNEXEC') SHR"
⋮
FILEMGR "$DSP DSNIN='FMNUSER.TEST.KSDS1',PROC=TOTALS"
⋮
"FREE DD(FMNEXEC)"
Note: The TSO commands ALLOC and FREE can also be issued outside the REXX program.

To enter a procedure from the terminal

  1. Code PROC=* in the File Manager function invocation.
  2. When you run the REXX program and it invokes the File Manager function, File Manager prompts you to enter procedure statements with the following messages:
    SYSIN DD is allocated to terminal
    Enter card input (EOD=NULL REPLY):
    Type your procedure statements, pressing the Enter key at the end of each line.
  3. Enter /+ as the last line to complete the procedure and indicate end of data. File Manager then runs the requested function using the entered procedure.