"As soon as you allow by-value parms, you can completely forget the leftmost bit technique to mark the last parameter (address)."
Not necessarily. One technique I have seen used elsewhere Is to add a 'dummy" last parameter of X'80000000' to mark the end of the list, but I do not know if COBOL and/or LE use this technique. Obviously both caller and called have to respect that convention. COBOL could also copy the BY VALUE parameter to a compiler-allocated temp storage area and pass the address of that area instead of the source area. For a large table or record area that could get quite expensive in CPU time if the call is done frequently, but it is at least transparent to the called program who does not have to know whether the value was passed by value or by reference. Again, I don’t know if any version of COBOL that supports BY VALUE paremeters uses that technique. Peter -----Original Message----- From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Bernd Oppolzer Sent: Tuesday, September 22, 2020 6:21 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Determining program name/number of paramaters from called COBOL program Am 22.09.2020 um 23:51 schrieb Farley, Peter x23353: > Current Enterprise COBOL compilers (and back as far as I know, even COBOL > F-level from MVT) always mark the last parameter address in the address list > with the bit 0 turned on, though I have not researched what current ones do > if the last parameter is "BY VALUE". Thanks :-) if you have by-value parameters (not addresses), then you're stuck; by-value integers, for example - s9(9) comp in COBOL speech - can be positive or negative and have the leftmost bit set off or on, so examining the "addresses" (which are in fact not addresses in this case) leads nowhere. Same goes for PL/1 BYVALUE parameters. As soon as you allow by-value parms, you can completely forget the leftmost bit technique to mark the last parameter (address). That's why C, for example, does not use nor support the VL bit, although variable numbers of parameters are supported (#include <stdarg.h>); instead the called function must be able to determine the total number of parms from one of the leading parms, like in the printf() function, for example. Kind regards Bernd > > Again for current Enterprise COBOL versions, the LE Vendor Interfaces manual > available in KC has the PPA1 format and in general how to locate it. > > Peter -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN