ADDRESS LINKMVS takes one parameter containing the name of the external 
procedure and the names of the parameters. Any required padding is the 
responsibility of the program.


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

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

On Mon, 22 Mar 2021 19:41:10 +0000, Jeremy Nicoll wrote:

>On Mon, 22 Mar 2021, at 19:27, Rich Tabor wrote:
>
>       LINKAGE SECTION.
>       01  FLD1  PIC X(08).
>       01  FLD2  PIC X(08).
>       01  FLD3  PIC X(20).
>     ...
> /* 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"
>
>
>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.
>
The lengths don't match.  Is this an invitation to buffer overflow?
Is it simply incumbent on the programmer to ensure that the
actual parameters are no shorter than the formal parameters?

I assume the names don't matter; only the addresses.

I'm not a COBOL programmer.  GIYF -- I found:
    
http://secure-web.cisco.com/1vkjMjOmTgTJMBmuPbRWHHvt2qQ2CBFXpiW0-17tsuaaV8t1eID6p5-HRYkzvnXuEsAuxIgo3_AkxqGem1f1D_LsA65qYxOseqx0vTMETPDn--ZExgJpJ8Ot5x7jqxJXBy0BJNKVbbvJGre_jBYxYkFoVgJCUVSbqFtPgBIbjrAdUQRfaW19dThXbxiY7kMsettBcaWvnTTEhR2bQt0McCX1UhnRhAPpiV80WIvRZic1rulOeQ_f0qaHo0HmUeTUsp5cRTRcM1sXSEV31kcsiqNQofob826t-Q6qBuhN2xv0iGm2K0jQ_u1KX_-qPhcOQzYgWaXiWa0OQuSkg_jQpOo1-s7HToXF0lsbk2Y-MyF9KT3EGDccnXrqCOONNs_dz9JcjzqNyWUKTmzmoj-sJFgfRv1UoxPzi-6wnvSdkpaaMvZEiELgodcyo2Lyx8B35/http%3A%2F%2Fwww.simotime.com%2Fcblpar01.htm
      *****************************************************************
       LINKAGE SECTION.
       01  PARM-BUFFER.
           05  PARM-LENGTH         pic S9(4)   comp.
           05  PARM-DATA           pic X(256).
      *****************************************************************
With declarations of that form, would it work to use ADDRESS LINKMVS
rather than LINKPGM?

-- gil

----------------------------------------------------------------------
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