I don't have a problem with checking return codes, but IMHO the SIGNAL 
statement is badly broken and the handling of exceptions is much better in, 
e.g., Ada, Java, PL/I.


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

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

<Chuckle> REXX isn't so simple after all! You would have been better off
writing your code in Java, or if you have installed the new Open XL
C/C++ compiler/runtime you could use the C++17 filesystem library.

To me, just having to check return codes instead of relying on
exceptions is a good enough reason to dodge REXX.

On 29/06/2022 6:32 am, Charles Mills wrote:
> 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&amp;data=05%7C01%7Csmetz3%40gmu.edu%7C2fc89587f8af44acab6c08da5956feba%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C637920527431418524%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=s%2FuaSVSV3PGhnejqfV6Lmvk7Vtcdw5aBHneKg5LIYUw%3D&amp;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.
>

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