Not quite. Everything in the ADDRESS statement after the environment is an 
expression. The expression 'CBLPGM "FLD1 FLD2 FLD3"' evaluates to 'TST01 FLD1 
FLD2 FLD3', so the statement calls TST01 with a three word parameter list 
pointing to the values of FLD1, FLD2 and FLD3. The initialization looks flaky; 
should it be

   FLD1 = LEFT('',80,'A')
   FLD2 = LEFT('',80,'B')
   FLD3 = LEFT('',80,'C')


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Jeremy Nicoll [[email protected]]
Sent: Monday, March 22, 2021 3:41 PM
To: [email protected]
Subject: Re: Can I use a REXX PLIST when calling a COBOL program?

On Mon, 22 Mar 2021, at 19:27, Rich Tabor wrote:

>  /* REXX */
>  CBLPGM = 'TST01'
>  FLD1 = SUBSTR('AAAAAAAAAAAAAAAA',1,80)
>  FLD2 = SUBSTR('BBBBBBBBBBBBBBBB',1,80)
>  FLD3 = SUBSTR('CCCCCCCCCCCCCCCC',1,80)
>  SAY 'FLD1 =' FLD1
>  SAY 'FLD2 =' FLD2
>  SAY 'FLD3 =' FLD3
>  ADDRESS LINKPGM CBLPGM "FLD1 FLD2 FLD3"

Notice here that the first parameter after the "LINKPGM" is the
literal name of the program (in this case plugged-in to the
statement by rexx variable substitution) whereas what follows
are the names of the rexx variables that represent three
successive parameters.

That is, one could also use

  address linkpgm "TST01 FLD1 FLD2 FLD3"

The logic inside support for "linkpgm" knows that the first value it
receives is the program name, not a variable containing it, and the
other values are the name of variables.  Linkpgm will )in this case)
build the parm list with three parm addresses in it.

--
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to