It was. Program 'callee' in my example below. (My example has three programs; 'callopt' calls 'callee'. 'callee' should call 'print-string' only for parms that were passed from program 'callopt'. I did not show the code for 'print-string', as it is not being passed a variable number of parameters.
Frank ----- Original Message ----- > From: Victor Gil <victor....@broadridge.com> > To: IBM-MAIN@bama.ua.edu > Cc: > Sent: Thursday, April 12, 2012 9:48 AM > Subject: Re: PL/I with variable PLISTs (was: LE C calling HLASM) > > Frank, > > The LINKAGE SECTION items and the 2 statements > > SET A-POINTER TO ADDRESS OF INPUT-LENGTH > IF BIN-WORD < 0 THEN <the high-bit is ON> > > should be coded in the CALLED SUBROUTINE [in your case "print-string"] > to determine what was passed by the CALLER. > > Sorry, if this was not obvious from the first note. > -Victor- > > > > Date: Wed, 11 Apr 2012 10:38:26 -0700 > From: Frank Swarbrick <frank.swarbr...@yahoo.com> > Subject: Re: PL/I with variable PLISTs (was: LE C calling HLASM) > > Hmmm.... Have you (or anyone) actually verified that this works? I just > wrote > the following programs: > > identification division. > program-id. callopt. > data division. > working-storage section. > 77 one pic x(4) value z'one'. > call 'callee' using one > goback. > end program callopt. > > id division. > program-id. 'callee'. > data division. > local-storage section. > 77 addr pointer. > 77 addr-val redefines addr pic s9(9) comp-5. > > linkage section. > 01 string-1 pic x(101). > 01 string-2 pic x(101). > > 01 result pic s9(8) comp-5. > > > procedure division using string-1 string-2 > returning result. > call 'print-string' using string-1 > set addr to address of string-1 > if addr-val not less than zero > call 'print-string' using string-2. > move zero to result > goback. > > When I run it, according to COBOL ADDR is set to x0F0960B8. I am guessing > that > the high-order bit is in fact set, but that COBOL does not reveal that > implementation detail to the COBOL application. > > Either that or I am doing something wrong. > > Frank > > > > ----- Original Message ----- >> From: Victor Gil <victor....@broadridge.com> >> To: IBM-MAIN@bama.ua.edu >> Cc: >> Sent: Wednesday, April 11, 2012 9:36 AM >> Subject: Re: PL/I with variable PLISTs (was: LE C calling HLASM) >> >> LINKAGE SECTION. >> >> 01 A-POINTER USAGE POINTER. >> 01 BIN-WORD REDEFINES A-POINTER COMP S9(8). >> >> ... >> CALL 'THEFUNCTION' USING MAGIC, INPUT-BUFFER, INPUT-LENGTH, > OMITTED, >> OMITTED RETURNING RC. >> >> SET A-POINTER TO ADDRESS OF INPUT-LENGTH >> IF BIN-WORD < 0 THEN <the high-bit is ON> >> > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN