The first thing I don't understand is the order of the code. Shouldn't the 
syscalls('ON') come before Address SYSCALL 'readdir 'BGZUSDIR' ls. lsst.'? 
OTOH, the code is looking where it should for the FD.

TSO doesn't create file descriptors, so an FD of 0 is what I would expect 
calling the code from ISPF.


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

________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Michael Babcock [bigironp...@gmail.com]
Sent: Thursday, May 14, 2020 10:46 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: USS Open in SYSCALL ENV

Sorry Yes Unix System Services.

The code isn’t mine.  It’s from IBM DBB which can be found here,
https://secure-web.cisco.com/1gI5RbPCRtzUf6FX3VBCXSQQDSNpnyDV7AevCGgQxWipNU_DbKtpM-JJ8ILA6jWQhWoazF9x962Ehp4LezNfX0_RdTKR4oDb61DN1AkD5bE5xkEJRSv50Yof7S3RhTPdhOf0q94koOjwkGJNOA0JgaUgpwUVtkNi3dPpjbYpY1bKf5zY5Rsu3ViKFY5de5EIZeJK1ef5UECATK2qGd96NbOGHrOCDjKUiSEOrzxXg5efg0PxcCDyloAUiVxiuhBZx0aEuCWe9oWy6c87qcLyNmrfE13r4gf9iIGbHJ9GfybqO2IW-RJywqcCJD0mYQS64qPzTKwawH_bj_GFn95XL0Gde-Ppcn6ZyvtE5RHypxsfeDG0RxOcx-t6d3V4XJQV77tXgI8wd-TxNRc44HHScj8L1wiMFFDq1cZbb92OULbViTGKWQafU-5TRnon4EsnX/https%3A%2F%2Fgithub.com%2FIBM%2Fdbb%2Fblob%2Fmaster%2FIDE%2FGitISPFClient%2Fsbgzexec%2Fbgzinit.rexx


I can’t reproduce the problem with some sample code I cobbled up.

On Thu, May 14, 2020 at 8:46 AM Seymour J Metz <sme...@gmu.edu> wrote:

> I assume that you mean Unix syscall environment. The documentation is a
> bit confusing, because the syscall commands set RETVAL, which is the
> behavior associated with a function. Are you looking at RC or at RETVAL?
> could you show your code? Are you running from IRXJCL, TSO or a Unix shell?
>
> My guess is that you did not invoke your code from a Unix shell and that 0
> was the first available file descriptor. If that is the case then you might
> want to open STDIN, STDOUT and STDERR at the beginning of your code.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> ________________________________________
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf
> of Michael Babcock [bigironp...@gmail.com]
> Sent: Thursday, May 14, 2020 8:53 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: USS Open in SYSCALL ENV
>
> In the USS REXX SYSCALL environment, is it normal for a command such as:
>
> open /u/xx35/test, o_rdwr+o_creat+o_trunc, 755
>
> To return a file descriptor of 0 (zero)?
>
> The reason I ask is that the subsequent write fails with
>
> RC 71 RSN 571011C
>
> Which basically says: file is not opened
>
> I thought fd 0 is normally STDIN.
>
>
> --
> Michael Babcock
> OneMain Financial
> z/OS Systems Programmer, Lead
>
> ----------------------------------------------------------------------
> 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
>
--
Michael Babcock
OneMain Financial
z/OS Systems Programmer, Lead

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