![]() |
Starting a Procedure
DO [N,] [ file | element | lib(element) | %name | %?] [, param, ...]
The procedure specified contains a PROC statement with any relevant parameters. Normally, the parameter mask will be displayed, in which all parameter values may be entered.
N Specifying DO N,... will suppress the parameter mask. The procedure parameters will be used as specified in the DO command (see below), or as they have been predefined in the PROC statement.
file The CFS procedure is stored in the specified file.
element The procedure is stored as the specified element in CFS.USERLIB or in the secondary userlib (see notes below). If the element is stored in a PLAM library, it must be a type S (Source) element.
lib(element) The procedure is stored as an element in the specified library.
%name A parameter set saved previously with the command SP %name under the abbreviation %name is to be used. A parameter set is a named procedure, together with a particular set of parameters. For a full description of the SP command and the use of %name, see page 11-.
%? All relevant parameter sets will be displayed in a list, from which one may be selected by marking it.
param Optional specification of CFS procedure variables. As for BS2000 DO procedures, both positional and keyword parameters can be given. The *PROC statement defines the type of parameter. Parameters cannot be specified in conjunction with a %name parameter set.
Positional parameter: Only the value of the required parameter should be specified. The correct sequence of positional parameters must be observed. If, for example, only the second parameter needs to be given, then an additional comma must be inserted as follows: DO procedure,,value.
Keyword parameter: The parameter name, followed by an '=' character, and then the parameter value must be entered. The parameter name and the default value can be defined in the *PROC statement.
Notes:
CFS will process a DO command in the following way:
If lib(element) or %name is specified, the CFS procedure to be executed is defined uniquely. In all other cases, the procedure is sought according to the following hierarchy:
a) CFS will search for an element with the specified name in the assigned userlib (Standard: CFS.USERLIB).
b) CFS will search for an element with the specified name in the secondary userlib. The secondary userlib can either be assigned with a /FILE ...,LINK=USERLIB command, or the default library, $userid.CFS.USERLIB.STD will be used. $userid is the userid under which the CFS program phase is stored.
c) A file is sought with the specified name.
When neither a), b) nor c) produce a result, an error message will be displayed. To change the standard CFS userlib, see the UL command on page 18-.
If the DO command is specified without any parameters, the last procedure to have been executed will be called again.
If a parameter value contains blanks or special characters, then the value must be enclosed in quotes.
If the value contains quotes, these must be entered twice.
If the procedure does not contain a *PROC statement, no mask-controlled parameter prompting is possible. It can also not be specified via a %name option.
If positional parameters are specified when calling a procedure that contains no *PROC statement, then these may be accessed from within the procedure only via the names &1 (first positional parameter), &2 (second positional parameter), and so on.