On Tue, 28 Jun 2022 12:02:57 -0700, Charles Mills <charl...@mcn.org> wrote:
>I have my "UNIX file" program, that I asked about a week or so ago, running. >Thanks for your help. > >SYSCALLS did not behave quite as I expected. Perhaps this is documented but >I did not see it. > >Does a Rexx program have to be running from a UNIX shell or the like to be >able to issue ADDRESS SYSCALLS? My Rexx is running under IRXJCL (or >IKJEFT01) in "legacy" batch and I consistently got a -3 for ADDRESS >SYSCALLS. Is that to be expected? Does it need instead to run under SH or >similar? Or am I missing something else? > >In the past I have just used ADDRESS SYSCALL "function parms ..." and that >works under IKJEFT01 batch. Is there anything wrong with doing it that way? >I did find you cannot say fd = ADDRESS SYSCALL "open ..."; you have to get >the fd from RC. I also had to code my own O_CREAT, etc. > >By the way, re the unrelated persistent storage discussion, I did not need >persistent storage but since I already had code that managed the "user" >pointer in the Rexx environment block I did use that. Persisting the storage >let me build the ECBLIST list once rather than every time; a few small >things like that. If I were working from scratch I would probably not have >bothered with persistent storage. The negative of the Rexx user pointer is >that all called routines share one word and have to coordinate their usage. >I have a management routine, it might be problematic with a disparate group >of developers. If I needed persistent storage I would use name/token to keep >the pointer around. > >Thanks again. > >Charles Before you can use "Address SYSCALL" from a TSO REXX program you have to initialize the SYSCALLS environment. I usually do it something like this: Call 'SYSCALLS' 'ON' /* Allow UNIX System Services Commands */ If result > 3 Then Do Say 'Error' result 'trying to Establish the', 'SYSCALLS Environment.' Exit result End -- Dale R. Smith ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN