This was in the ILE Cobol Programmer's Reference manual on the iSeries Information Center.
<i>If you do not want the called program to receive a corresponding argument or if you want the called program to use the default value for the argument, specify the OMITTED phrase in place of the data item on the CALL...BY REFERENCE or CALL...BY CONTENT statement. For example: CALL...BY REFERENCE OMITTED CALL...BY CONTENT OMITTED
In the called program, you can use the CEETSTA API to determine if a specified parameter is OMITTED or not. </i>
The following is a link to the manual for V5R3:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/books/sc092540.pdf
================================================================
However, some care must be taken. The term "program" in COBOL also refers to 'subprograms'. In the case of OMITTED parameters, note the specific rules in the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books/sc092539.pdf">COBOL Reference manual</a> for the BY REFERENCE clause of the CALL statement:
-----------------------------------------------------------------------------
<b>OMITTED</b>
For standard parameters when a parameter is passed BY REFERENCE, a pointer to the original data item is passed to the called program. When OMITTED is specified, a NULL pointer is passed to the called program. In this case, the called program will use its default value.
<i>OMITTED can only be specified on calls to programs with a LINKAGE TYPE of procedure.</i>
-----------------------------------------------------------------------------
The closing sentence is where care is needed. There are cases where 'omitted' parameters may be specified for calls to *PGMs. But the rules can require research and practice before being always predictable.
Tom
Last Wiki Answer Submitted: January 30, 2010 10:07 am by WaltZ400645 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.