MUMPS Programming/simple input and output

MUMPS uses the WRITE (abbreviated W) command for output and the READ (R) command for input. Unless specified by the USE (U) command, output defaults to the STDOUT equivalent for the implementation and input from STDIN equivalent.

The USE command redirects the I/O device to other devices. Its syntax varies from implementation to implementation. On older PDP-11 computers running DSM-11, devices were given integer designators. VAX-DSM and other implementations allowed strings to specify host OS devices.

The default device for any particular running instance is always $PRINCIPLE ($P) and most implementations will also accept 0 as the equivalent of $P.