Using the RUN function

The first argument to the RUN function is the name of the map to be executed.

On z/OS, this must be the DDNAME that identifies the deployed map. To ensure this, the z/OS Batch Command Server converts the map name to a legal z/OS DDNAME by removing drive, path, and file extension information if it exists, converting _ characters to # characters and translating the remaining characters to uppercase. For example, the map rule RUN(" install_dir \mymaps\map_10.mmc") executes the map identified by the DDNAME MAP#10.

When using the RUN function, the z/OS Batch Command Server execution log, audit log, trace and problem resolution output must be written to individual datasets for each level of recursion; otherwise the output from different recursion levels are mixed together and will be unintelligible. By default, output from a map executed with the RUN function is directed to dynamically-allocated print datasets assigned to the default SYSOUT class for the job. This may be overridden by coding additional DD statements in the JCL. For each level of recursion, four DD statements should be added to your execution JCL:

  • RUNLOG nn z/OS Batch execution log file
  • RUNAUDnn Data audit log file
  • RUNTRCnn Trace file
  • RUNDBGnn z/OS Batch problem resolution file (used with Customer Support)

where nn is the level of recursion (always two positions, zero-filled).

For example, if an executed map issues a RUN function and the map to be run does not execute any other maps, one level of recursion exists and the following statements should be added to the JCL step:


A map executed using the RUN function is loaded once and is removed from storage when the task ends or when the map executed is different from the last map executed. Maps repeatedly executed are not reloaded each time.

Statically allocated temporary datasets are reused when a map is executed repeatedly using the RUN function. For example, consider the following scenario: MAPA calls MAPB 100 times in succession using the RUN function. MAPA uses seven temporary files and MAPB uses three. In this example it is necessary to statically allocate, not 307 temporary datasets (7 + (100 * 3)), but 10 temporary datasets. MAPA will use SYSTMP01 through SYSTMP07 and MAPB will reuse SYSTMP08 through SYSTMP10 each time it is executed.