195 pts.
 %parms and ILE/COBOL
Is there a way in COBOL to determine how many parms have been passed in? (like the %parms bif in rpgiv)

Software/Hardware used:
ASKED: October 9, 2007  3:18 PM
UPDATED: January 30, 2010  10:07 AM

Answer Wiki:
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  WaltZ400   645 pts.
All Answer Wiki Contributors:  WaltZ400   645 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _