Thanks much, David. You might want to see my last post on this subject. The
problem I had was with retrieving the *second* parm pointed to by R1, not
the first; and I've got it solved thanks to input from this list. The length
or format of parm one was never an issue.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:ibm-m...@bama.ua.edu] On Behalf
Of David Waldman
Sent: Tuesday, December 29, 2009 10:13 AM
To: IBM-MAIN@bama.ua.edu
Subject: Re: argv for z/OS C++ batch

Charles,

>From the 'Language Environment Programming Guide',
 
PLIST indicates in what form the invoked routine should expect the argument 
list. You can specify PLIST with the following values under Language 
Environment: 

HOST The argument list is assumed to be a character string. The string is 
located differently under various systems as follows: 

     Under TSO, if a CPPL is detected, Language Environment gets the
     string from the command buffer. 

     Under TSO, if a CPPL is not detected, Language Environment assumes a

     halfword-prefixed string in the MVS format. 

     Under MVS, Language Environment uses the halfword-prefixed string.

OS The inbound parameter list is assumed to be in an MVS linkage format in 
which register 1 points to a parameter address list. No run-time options are

available. Register 1 is not interrogated by Language Environment.

The PLIST(HOST) setting allows the object to execute under MVS  
(assuming a halfword-prefixed string), or under TSO (using the CPPL or the
MVS-format parameter list). Specify PLIST(HOST) to default to the 
argument list format for the operating system under which your application
is running.

Another example using LINK and specifying a half-word prefixed length:

LINK EP=pgmname,PARAM=PPARM   
PPARM    DC    H'17',C'PARM1 PARM2 PARM3'

With ARGPARSE and PLIST(HOST) the results should be:

4                /* argc   */
pgmname     /* argv0 */
PARM1        /* argv1 */
PARM2        /* argv2 */
PARM3        /* argv3 */

regards,
Dave Waldman


On Mon, 28 Dec 2009 09:17:17 -0600, David Waldman 
<david.p.wald...@lmco.com> wrote:

>Charles,
>
>Try specifying the length as the 1st parm.
>
>ATTACH EP=CPGM,ECB=STECB,PARAM=(PPARM)
>
>PPARM    DC    H'17',C'PARM1,PARM2,PARM3'
>
>Your results should be:
>
>2                               /* argc  */
>CPGM                         /* argv0 */
>PARM1,PARM2,PARM3    /* argv1 */
>
>hth,
>Dave Waldman
>
>
>On Sat, 26 Dec 2009 16:14:39 -0500, Charles Mills <charl...@mcn.org>
>wrote:
>
>>Question: Does anyone know if a NOARGPARSE C++ program called via LINK 
or
>>ATTACH would receive parm 2 - the second word pointed to by R1 -
>anywhere?
>>Is there a recommended way to do this?
>>
>>What I'd like to end up with is a C program that "did me no favors" - if
>>invoked from JCL EXEC, then argv[1] would point to the PARM= string if any
>>("as is") and if called via LINK or ATTACH would get the vector pointed to
>>by the caller's R1 as argv[1, 2, 3 .].
>>
>>Anyone know the answer to this?
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to