You can invoke a command either with an explicit environment or with an 
explicit environment. An address statement with only one operand changes the 
current (implicit) environment, but it does cause any environment to go away. 

There is no PEN environment; you need address SYSCALL "open" filename.

I don't understand the -3; The open should not be changing the current 
environment. I would open an incident with IBM.



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

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Charles Mills [[email protected]]
Sent: Tuesday, June 28, 2022 6:50 PM
To: [email protected]
Subject: Re: Some questions on SYSCALL

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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ibm.com%2Fdocs%2Fen%2Fzos%2F2.1.0%3Ftopic%3Dscd-write&data=05%7C01%7Csmetz3%40gmu.edu%7Cd91879481bd749a27b7d08da5958a5ff%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C637920534531244150%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zzPxpUykOrgShTdAa9dVP1GDRqloEBdNNhkKdD%2Fh80E%3D&reserved=0
> 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

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

Reply via email to