Using the DCL Definition Type
The DCL shell is the default, and usually the only, shell on HP OpenVMS. It is used for almost all scripting on VMS systems, as it is guaranteed to be installed and there is a low likelihood of any other shell being installed. Even Perl is not very popular on OpenVMS (although support for this is anticipated for a future release).
Variables and Parameters
- Parameters in the process definition are manipulated in the DCL source as global symbols, using the standard
SYMBOL
or'SYMBOL
syntax. - All parameters are passed as string values. Numbers are translated automatically. Dates are sent and retrieved using the Script Date Format.
- Out parameters are supported.
For example, a process definition with a parameter named P_IN and a parameter P_OUT can read and set them as follows:
$ write sys$output "The parameter P_IN has value ''P_IN'"
$ P_OUT=="New Output value for P_OUT"
If you use parameters named P1 through P8 please note that your DCL script runs as a nested DCL script. It will have local symbols P1 through P8 but they are not set to any value, as the script is called without positional parameters. This means that if you use process definitions that use the parameters P1 through P8 that you must delete the local symbol before you can access the global symbol value.
For instance, to print the value of the parameter P1 use:
$ delete/symbol/local P1
$ write sys$output "The parameter P1 = ''P1'"
Returning an Error
The DCL $status is correctly reflected in the return code of the process, and the process status is also derived using the normal VMS method. As the VMS exit status contains the success/failure of the process in the lower three bits of the return code, a large numerical value in the return code may (and will) still indicate success.
Standard files
Your DCL code runs with it's default directory set to [...<job>.JobFiles]
. Any files that it creates there will be attached to the process. This directory normally contains three standard files:
STDOUT.LOG;1
which will contain any output sent toSYS$OUTPUT
, including any DCL verify output written by your script.STDERR.LOG;1
which will contain any output sent toSYS$ERROR
, including any DCL verify output written by the DCL process definition runner and theSYLOGIN.COM
andLOGIN.COM
procedures, as well as the trailing process information written by the command processor when the process finishes.STDLOG.LOG;1
which will contain any debugging and informational output created by thejob-processor
. If you are not running the process server with logging at debug level this file will usually be empty and be deleted automatically.
In most VMS installations, SYLOGIN.COM
contains this in the first two lines:
$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
As the Redwood Server platform-agent starts logging from a very early stage the STDERR.LOG
file may contain the above output. To remove this output, change the SYLOGIN.COM
file to start as follows:
$! VERIFY = 'F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
$ Set NoOn
Note the added comment and quote characters, and the reversed order. The $!
line is not 'logged' but it is executed by DCL as it contains the magic incantation 'F$VERIFY
.