Running Your Exec Files

Exec procedures are run when you enter the file name of the exec file. You can precede the file name on the command line with the CMS command, EXEC. For example:
exec test

Where:

TEST
specifies the file name of the exec file.

For example, an exec named THANKYOU would be processed when you entered either:

exec thankyou   or   thankyou

You must precede the exec file name with the exec command when you:
  • Run an exec from CMS EXEC and EXEC 2 execs.
  • Run an exec from REXX with ADDRESS COMMAND. (The default is ADDRESS CMS, which means exec need not be specified.)
  • Run an exec from a program.
  • Call a REXX exec recursively.
  • Have the implied exec (IMPEX) function set OFF for your virtual machine.
The implied exec (IMPEX) function is controlled by the SET command. It lets you treat exec files as commands so that you only must enter the file name of the exec program. The default setting for IMPEX is ON; you almost never need to change it. To find out what the IMPEX setting is, enter:
query impex
If the response is:
IMPEX   = OFF
this means that the exec command must precede the exec file name to run an exec procedure. To set IMPEX to ON, so that you only need to enter the exec file name, enter:
set impex on
An exec procedure having a synonym defined for it can be run by its synonym if the implied exec (IMPEX) function is on. You may use the synonym for an exec program within a REXX program.

One exec file that you never have to specifically process is a PROFILE EXEC. It automatically runs after you IPL CMS, when your directory or minidisk with a mode of A is accessed. PROFILE EXECs are discussed in Creating a PROFILE EXEC.