[Deutsche Version]

Undocumented OpenVMS: MCR

The mcr command can be used to run programs that require parameters without defining a symbol or assigning DCL$PATH.
The general syntax is

	$ mcr disk:[dir]name <parameters,...>

This is equivalent to defining and invoking the following symbol:

	$ name :==$disk:[dir]name
	$ name <parameters,...>

If you skip the disk:[dir] specification a default of sys$system is used.


History of the MCR command

To ease migration between RSX and VMS, it was possible to run non-priviledged RSX-programs on VMS from the beginning. Also the common RSX development tools were made available on VMS. On the one hand this was achieved by implementing a "PDP-11" compatibility mode on the VAX CPU, which enabled the chip to execute PDP-11 instructions. On the other hand one needed the appropriate software "RSX Application Migration Executive (AME)", which was part of the standard VMS distribution up to VMS V3.7 and became a layered product for V4.0 up to V5.5x.

On RSX the standard command line interpreter is MCR (Monitor Console Routine). MCR was part of the AME and could be started from DCL with the MCR command (without parameters). This invoked a subprocess, where one could execute one or more MCR commands.

Opposite to DCL, MCR does not contain commands for procedural programming (like GOTO, GOSUB, RETURN, CALL, or IF), but is used mainly to run external programs (there are a few built-ins though). Every command not known as a built-in was interpreted as the name of an external image (like it is on DOS or Unix). In VMS this was emulated by using "MCR <imagename>", which invoked the given RSX program directly. Since the RSX programs expect parameters to be present on the commandline it was possible to specifiy these directly using MCR, which is not possible with the DCL RUN command.

All programs being part of the RSX AME are stored in the directory SYS$SYSROOT:[001054] (This strange name is caused by the naming convention of RSX, which allowed only digits in directory names). To allow the activation of these programs as well as of self-written ones from DCL via MCR, the logical name SYS$SYSTEM is defined as a search list logical during startup of the AME:

   	"SYS$SYSTEM" = "SYS$SYSROOT:[SYSEXE]" (LNM$SYSTEM_TABLE)
        	= "SYS$SYSROOT:[001054]"   
   

I.e., if one invokes a program via MCR, first the SYS$SYSROOT:[SYSEXE] directory is searched for the executable, and then the generic AME directory SYS$SYSROOT:[001054].

At one point in time a subtle programer noticed, that one can also use this method to invoke VMS programs with parameters, something which usually requires a symbol definiton with DCL. Starting then there was no holdback: MCR still was not a documented command, but was used all over the place in DCL procedures written by DEC employees.

Starting with OpenVMS 6.0 RSX AME is no longer supported and most probably really nobody works anymore seriously with the RSX AME. The MCR command OTOH will almost certainly stay around also in future OpenVMS versions, since it would require a lot of recoding in DCL procedures from DEC to drop it.

One interesting point to note is that MCR parses its first argument in a nonstandard way - although a default file specification of SYS$SYSTEM:.EXE applies when you mention neither device nor directory,

        $ MCR []PROGRAM {parameters...}
   

is sufficient to invoke PROGRAM.EXE in the current default directory, where normally an explicit device specification would be necessary.

 Valid CSS! [HTML 4.0 Checked!] [Viewable With Any Browser]

Comments to: Martin P.J. Zinser
Last modified: 20020628