Difference between revisions of "Command Procedure"

From VSI OpenVMS Wiki
Jump to: navigation, search
(Created page with "A '''command procedure''' is a file that holds a sequence of DCL commands to be executed by the system in sequence interactively or as a batch job - essentially a DCL scri...")
 
(Change to redirect: details identical.)
(Tag: New redirect)
 
Line 1: Line 1:
A '''command procedure''' is a file that holds a sequence of DCL commands to be executed by the system in sequence interactively or as a batch job - essentially a [[DCL]] script. Command procedure files have the [[File extension|extension]] of .COM (this is not required; however, this is the default file type for [[@|interactive command procedure execution]].
+
#REDIRECT [[Command procedure]]
 
 
=Rules=
 
The following is required for OpenVMS command procedures:
 
1. Every line in a command procedure that is not a data line has to begin with the dollar sign ($):
 
<nowiki>
 
$ if f$mode() .nes. "INTERACTIVE" then exit
 
</nowiki>
 
2. [[Comment|Comments]] begin with an exclamation point (!). Comment lines begin with a dollar sign AND an exclamation point ($!):
 
<nowiki>
 
$ if count .eq. 5 !Last element
 
$! Return to the previous level
 
</nowiki>
 
 
 
=Example=
 
<nowiki>
 
$! This command procedure displays a message based on the current day of the week.
 
$ say := write sys$output
 
$ day = f$cvtime(,,"WEEKDAY")
 
$! show sym day
 
$ say "Hooray, it's ''day'!"
 
</nowiki>
 
 
 
=Command procedures used by OpenVMS=
 
* [[AUTOGEN]]
 
* [[LOGIN.COM]]
 
* [[:Category:Startup Command Procedures|Startup Command Procedures]]
 

Latest revision as of 13:00, 23 March 2022

Redirect to: