I think that for write you pass the buffer by name, not its Rexx value. Believe 
it or not.

That is what the example in the manual shows, and that is what is working in my 
code:

"write" Filefd "Record" Length(Record)

Is writing the contents of Record, not the literal "Record". Definitely 
counterintuitive. Definitely astonishing.

Maybe (Record) would work. I have not tried, and that is not what the examples 
show.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Paul Gilmartin
Sent: Tuesday, June 28, 2022 3:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Some questions on SYSCALL

On Tue, 28 Jun 2022 14:42:45 -0700, Charles Mills wrote:

>I am still not quite understanding the usage of Rexx variables with SYSCALL.
>
>If myFileName = "/u/myfile" then do I want to code
>
>"SYSCALL open myFileName" or "SYSCALL open" myFileName  ?
> 
address SYSCALL "open" myFileName  /* Rexx evaluates myFileName.  */

>In other words, does myFileName get passed by value, or does SYSCALL do an 
>IRXEXCOM to find its value from its name?
>
Not really.
    say myFileName  /* Rexx evaluates.  */

>Ditto for SYSCALL write. The example on 
>https://www.ibm.com/docs/en/zos/2.1.0?topic=scd-write shows
>
>"write" fd "buf"
>
>Which makes no sense to me at all. fd is passed by value but "buf" by name?
>
Both by value.
    string = "Hello world"ESC_N
    address SYSCALL "write 1 (string)"

Specifying a syscall command
    Specifying strings
        A variable name enclosed in parentheses.
        Strings that contain both the single quotation mark and
        double quotation mark characters must be stored in a variable,
        and you must use the variable name.

-- 
gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to