And another question: what makes ADDRESS SYSCALL "go away"?
I would post more context but I don't know what the relevant bit is. (If I knew
then I wouldn't be asking!)
I do SYSCALLS("ON")
I do ADDRESS SYSCALL
I do "open" filename etc. Not ADDRESS open, just "open" filename ...
That all works. Subsequently I do "write" etc. and it fails with a -3. If I go
back and precede it with ADDRESS SYSCALL then it works. What has made ADDRESS
SYSCALL "go away"? What I do NOT do
- I don't do any other ADDRESS in the Rexx. I checked with the editor.
- I don't invoke any other Rexx
What I do do is call an assembler routine. I just got through writing the
assembler, so I can tell you that it does not do any IRXxxxxx functions or
anything cute like that. It does not "mess with" Rexx at all. It picks up one
argument and returns 30 bytes or so of result. Does calling out to an assembler
program inherently reset ADDRESS? The assembler is an alias in a load module in
STEPLIB; there is no "function package."
Charles
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Charles Mills
Sent: Tuesday, June 28, 2022 3:33 PM
To: [email protected]
Subject: Re: Some questions on SYSCALL
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:[email protected]] On Behalf
Of Paul Gilmartin
Sent: Tuesday, June 28, 2022 3:01 PM
To: [email protected]
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 [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
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN