Previous Page | Next Page

Functions and CALL Routines under OpenVMS

VMS Function: OpenVMS



Spawns a subprocess and executes a DCL command.
Category: General-Purpose OpenVMS
OpenVMS specifics: All aspects are host-specific

Syntax
Details
Comparisons
See Also

Syntax

VMS(DCL-command)

DCL-command

is the DCL command that is passed to the subprocess. It can be a character variable, a character literal enclosed in double quotation marks, or another character expression.


Details

The VMS function spawns a subprocess and executes the command that is passed to it. Any output that is produced is sent to SYS$OUTPUT. If you are using the SAS windowing environment, the results appear in a new window. To close the new window, select the File menu and then select Exit . This is consistent with the behavior of the X statement and the X command.

If the VMS function executes successfully, the return value is 0. Otherwise, the return value is an OpenVMS error code that indicates why the function failed. If you supply an invalid command, you will receive a return error code such as the following:

229520

%CLI-W-IVVERB, unrecognized command verb - check validity and spelling.


Comparisons

The VMS function is similar to the X statement, the X command, the %SYSEXEC macro, and the CALL SYSTEM routine. In most cases, the X statement, the X command, or the %SYSEXEC macro are preferable because they require less overhead. However, the VMS function is useful for conditional processing because it returns a return code. The CALL SYSTEM routine can be useful in certain situations because it is executable, and because it accepts expressions as arguments.


See Also

Previous Page | Next Page | Top of Page