If a default value is defined for an input parameter, the parameter does not have to be specified in the function call if the default value is to be transferred (the value of default settings is always underlined in the syntax representations of functions).
For functions that have only one input parameter, such as DATE( ), this means that the parentheses identifying the function call are sufficient. They can even be omitted if no variables have been defined with the same name.
Example
The following function calls for the DATE( ) function are equivalent, provided that there is no variable with the name DATE:
/DATE(FORMAT=*ISO) /DATE(*ISO) /DATE( ) /DATE /SHOW-VARIABLE D D = 1996-05-20141
For functions with several input parameters, the following rules apply:
If all input parameters are specified as keyword parameters, the input parameters for which the default value is to be transferred can be omitted without replacement.
If all input parameters are specified as positional parameters, the order of the input parameters must be correct. Input parameters for which the default value is to be transferred must be separated by commas, unless they are located at the end of the parameter list.
If positional and keyword parameters are mixed, the positional parameters must be specified first, followed by the keyword parameters. Input parameters for which the default value is to be transferred must be separated in the list of positional parameters by commas.
Examples
The example of the FILL( ) function illustrates the rules for transferring default values. The following syntax applies for the input parameters of FILL( ):
FILL |
STRING = string_expression ,LENGTH = number ,SIDE = *RIGHT / *LEFT ,FILL-BYTE = C' ' / character |
In this example, default settings are defined for the input parameters SIDE and FILL-BYTE:
*RIGHT means that filling is to the right
C’
If you now wish to transfer both default values and insert the contents of the ADDRESS variable for STRING and the number 18 for LENGTH, the following function calls are equivalent:
FILL(STRING=ADDRESS, LENGTH=18, SIDE=*RIGHT, FILL-BYTE=C' ') FILL(STRING=ADDRESS, LENGTH=18,,) FILL(STRING=ADDRESS, LENGTH=18) FILL(ADDRESS,18)
If you specify the parameter names, you can also change the order of input parameters:
FILL(LENGTH=18, STRING=ADDRESS)
If only the default value for SIDE is to be transferred and different fill characters are to be defined (e.g. dots), the following function calls are equivalent:
FILL(STRING=ADDRESS, LENGTH=18, SIDE=*RIGHT, FILL-BYTE=C'.') FILL(STRING=ADDRESS, LENGTH=18, FILL-BYTE=C'.') FILL(ADDRESS, 18, SIDE=*RIGHT, FILL-BYTE=C'.') FILL(ADDRESS, 18, ,C'.')
Whenever you use abbreviation options, be careful that you do not make familiarization with the procedures unnecessarily difficult for your “successors”. You should abbreviate function calls only to the extent that they remain straightforward and easily understood.