%OMITTED (Return Parameter-Omitted Condition)
%OMITTED (Return Parameter-Omitted Condition)
%OMITTED (Return Parameter-Omitted Condition)
%OMITTED returns the *ON if the specified parameter was passed to the program or procedure and *OMIT was passed as the parameter. The operand for %OMITTED is the name of a parameter defined as part of the procedure interface for the current procedure.
Use %PASSED if you want to know whether the parameter is available to be used in the procedure. Use %OMITTED if you want to know that *OMIT was passed for the parameter.
Note:
- *OMIT must be specified for the OPTIONS of the procedure interface for the specified parameter.
- A parameter defined using a *ENTRY PLIST cannot be specified as the operand for %OMITTED.
- A parameter specified in the procedure interface for the main procedure cannot be specified as the operand for %OMITTED in different procedure.
- The parameter must be specified the same way it appears in the procedure interface parameter list. If the parameter is an array, an index cannot be specified. If the parameter is a data structure, a subfield cannot be specified. If the parameter is a file, a record format cannot be specified.
Note: If the passed parameter is based on a pointer and the pointer is null, %OMITTED returns *ON. With OPTIONS(*OMIT), when the address of the parameter is null, it appears as though *OMIT was passed.
For more information, see Built-in Functions.
Examples of %OMITTED
-
The procedure interface for procedure A has three parameters.
- The parameter must be passed, but *OMIT can be passed for the parameter.
- The parameter is optional. *OMIT can be passed for the parameter.
dcl-proc a; dcl-pi *N; p1 char(10) options(*OMIT); // 1 p2 char(10) options(*OMIT : *NOPASS); // 2 end-pi;Several calls are made to the procedure.
The call to procedure A Result of %OMITTED(p1) Result of %OMITTED(p2) a(fld1);*OFF *OFF a(*OMIT);*ON *OFF a(fld1 : fld2);*OFF *OFF a(fld1 : *OMIT);*OFF *ON