CALL

From VSI OpenVMS Wiki
Revision as of 12:27, 2 December 2019 by Jane.doe (talk | contribs) (Created page with "'''CALL''' is a DCL command that transfers control to a labeled subroutine within a command procedure. CALL is e...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

CALL is a DCL command that transfers control to a labeled subroutine within a command procedure. CALL is executed inside DCL; no image is invoked.

Syntax

 CALL  label [parameter [...]]

Label

Specifies a label of 1 to 255 alphanumeric characters that appears as the first item on a command line. A label cannot contain embedded blanks. When the CALL command is executed, control passes to the command following the specified label. The label can precede or follow the CALL statement in the current command procedure. A label in a command procedure must be terminated with a colon (:). Labels for subroutines must be unique. Labels declared in inner procedure levels are inaccessible from outer levels.

Parameter

Specifies from one to eight optional parameters to pass to the command procedure. Use quotation marks (" ") to specify a null parameter. The parameters assign character string values to the symbols named P1, P2, and so on in the order of entry, to a maximum of eight. The symbols are local to the specified command procedure. Separate each parameter with one or more spaces. Setting bit 3 of DCL_CTLFLAGS to 1, specifies from one to sixteen optional parameters to pass to the command procedure. Use quotation marks (" ") to specify a null parameter. The parameters assign character string values to the symbols named P1, P2, and so on in the order of entry, to a maximum of sixteen. The symbols are local to the specified command procedure. Separate each parameter with one or more spaces. If you clear the bit 3 of DCL_CTLFLAGS, the default parameters are set (that is, (P1, P2, . . . P8)). You can specify a parameter with a character string value containing alphanumeric or special characters, with the following restrictions:

  • The command interpreter converts alphabetic characters to uppercase and uses blanks to delimit each parameter. To pass a parameter that contains embedded blanks or lowercase letters, enclose the parameter in quotation marks (" ").
  • If the first parameter begins with a slash (/), you must enclose the parameter in quotation marks.
  • To pass a parameter that contains quotation marks and spaces, enclose the entire string in quotation marks and use two sets of quotation marks within the string.

Qualifier

/OUTPUT writes all output to the file or device specified. By default, the output is written to the current SYS$OUTPUT device and the output file type is .LIS. System responses and error messages are written to SYS$COMMAND as well as to the specified file. If you specify /OUTPUT, the qualifier must immediately follow the CALL command. The asterisk (*) and the percent sign (%) wildcard characters are not allowed in the output file specification. You can also redefine SYS$OUTPUT to redirect the output from a command procedure. If you place DEFINE SYS$OUTPUT filespec as the first line in a command procedure, output will be directed to the file you specify.