01 util-2nd. 02 2nd-called pic x(30). 02 2nd-key pic x(256). 02 filler pic x(100). ... procedure division using util-1st util-2nd. ... call "C$CARG" using okay, util-2nd, arg-description if (okay) move "Y". to argument-is-present else move "N". to argument-is-present end-if
NOTE: if the named parameter is NOT passed than it crashes with a runtime error due to the missing parameter.... so the function is somehow useless to understand if this parameter is passed or not... regards Giovanni
01 util-2nd. 02 2nd-called pic x(30). 02 2nd-key pic x(256). 02 filler pic x(100). ... procedure division using util-1st util-2nd. ... call "C$CARG" using okay, util-2nd, arg-description if (okay) move "Y". to argument-is-present else move "N". to argument-is-present end-if
NOTE: if the named parameter is NOT passed than it crashes with a runtime error due to the missing parameter.... so the function is somehow useless to understand if this parameter is passed or not... regards Giovanni
The program will not crash if the passed linkage is incorrect provided (a) you do not compile with the -Za directive and then do not address the missing linkage. You can then use C$NARG to first determine how many linkage parameters are passed and code accordingly.