If a command implemented by means of a procedure is to be generally available:
the procedure must be shareable and
the user ID under which the procedure file is cataloged must be specified as part of the file name in the command definition (see ADD-CMD).
In the operand list that SDF passes to the procedure the operands may be defined as keyword operands or as positional operands. In the case of a keyword operand, a different name may be passed than the one that appears in the command syntax (see ADD-OPERAND ...,RESULT-OPERAND-NAME=).
Operand definitions | Command input | Parameter list |
//ADD-OPER OP1,...,RES-OPER-N=*POS(1) | /CMD W,X,Y,Z | ('W','X',OP3='Y', |
Several operands for a command may be concatenated to form a single operand and passed to the procedure in this form (see ADD-OPERAND ...,RESULT-OPERAND-NAME=,CONCATENATION-POS=).
Operand definitions | Command input | Parameter list |
//ADD-OPER OP1,...,RES-OPER-N=*POS(2), | /CMD X,Y,Z /CMD X,OP3=Z, | ('Z','YX') |
//ADD-OPER OP1,...,RES-OPER-N=OP2, | /CMD X,Y,Z /CMD X,OP3=Z, | ('Z',OP2='YX') |
An operand for which there is only one permissible value may be so defined that, while it does get passed to the procedure, it does not appear in the command syntax (see ADD-OPERAND ...,PRESENCE=*INTERNAL-ONLY). If the operand constitutes the only operand in a structure, then the structure will also be invisible in the command syntax. This can be used, among other things, for passing branch destinations to the procedure, to which processing within the procedure may branch depending on input alternatives (see “Example 1: Assembly command”).
On the other hand, an operand which, for example, is needed only for structuring the command syntax, and not for the implementation, may be suppressed when operands are passed to the procedure (see ADD-OPERAND ..., PRESENCE=*EXTERNAL-ONLY). ADD-VALUE ...,VALUE=<c-string>(...,OUTPUT=...,...),... can be used to direct SDF to convert defined single values to other values before passing them on to the procedure or to suppress transfer of the values. For example, it can be specified that SDF is to pass on the value ’ISD’ to the procedure instead of the value ’YES’ defined for the input (see example 1).
ADD-VALUE ...,OUTPUT=NORMAL(STRING-LITERALS=...) can be used to specify whether SDF is to recode an operand value before passing it on to the procedure (<c-string> to <x-string> or vice versa).
ADD-VALUE ...,STRUCTURE=*YES(SIZE=...,...),... is used to determine whether a structure will be integrated into the operand form at the MINIMUM and MEDIUM level of guided dialog or whether SDF will display a separate subform for this structure.
Normally, the default values of the ADD statements can be used extensively when defining a command. However, these statements also provide a number of means for tailoring a command definition to the user’s individual requirements. Further information on this can be found in the descriptions of the ADD statements.