Hello Scott,
Below are 2 attempts at the child REXX and the parent REXX. The REXX child
environment clearly knows to map STDIN to SYSTSPRT, but IPCS does not. I'm
wondering if IPCS uses TGET to read SYSTSIN.
Regards
Steve.
/*REXX child 1*/
say address()
parse arg arg1 arg2 arg3 .
say "myrexx.rx started arg1="arg1 "arg2="arg2 "arg3="arg3
address tso
"allocate dataset('"arg2"') file(IPCSDDIR) SHR"
"allocate dataset('"arg3"') file(DUMPIN) shr"
say "queued()="queued()
arg1
say "myrexx.rx ended" rc
exit:
exit(0)
/*REXX child 2*/
do i = 1 by 1 until cmd.i = ''
parse external cmd.i
say i cmd.i
end
cmd.0 = i-1
parse arg arg1 arg2 arg3 .
say "myrexx.rx started arg1="arg1 "arg2="arg2 "arg3="arg3
alloc="ALLOC DD(SYSTSIN) TRACKS SPACE(1,1) LRECL(80) RECFM(F) REUSE"
xrc = bpxwdyn(alloc)
address MVS "EXECIO * DISKW SYSTSIN (FINIS STEM CMD."
address tso
"allocate dataset('SA.TEMP.PDS') file(IPCSPDS) SHR"
"allocate dataset('"arg2"') file(IPCSDDIR) SHR"
"allocate dataset('"arg3"') file(DUMPIN) shr"
say "queued()="queued()
arg1
do queued()
pull data
say data
end
say "myrexx.rx ended" rc
exit:
exit(0)
/*REXX parent */
RC = SYSCALLS('ON')
If RC<0 | RC>4 Then do
say>syscalls()' rc'
return
end
Address SYSCALL
env.0 = 2
env.1 = "PATH=/bin/"
env.1 = "PATH=/userhome/sa/:/bin/"
env.2 = "_BPX_SHAREAS=YES"
"pipe pfd."
pipeout = pfd.2
pipein = pfd.1
"pipe p2fd."
pipe2out = p2fd.2
pipe2in = p2fd.1
map.0=-1
map.0=pipe2in /*child stdin*/
map.1=pipeout /*child stdout to pipe*/
map.2=pipeout /*child stderr to pipe*/
map.3=pipeout
map.4=pipeout
map.5=pipeout
dsn = "ZZ.DUMP.SAALOADR.D141003.T081348.S00143"
str = "OPEN PRINT (FILE(STDOUT) CAPS"||'15'x
'write' pipe2out 'str'
str = "SETDEF DSN('"dsn"') PRINT NOTERMINAL LIST",
||'15'x
'write' pipe2out 'str'
str = "VERBX VSMDATA 'CURRENT'"||'15'x
'write' pipe2out 'str'
str = "END"||'15'x
'write' pipe2out 'str'
'close' pipe2out
parm.0=4
parm.1="/userhome/sa/myrexx.rx"
parm.1="myrexx.rx"
parm.2="IPCS"
parm.3="SA2.DDIR"
parm.4=dsn
'spawnp' parm.1 '6 map. parm. env.'
spid = RETVAL
serrno = ERRNO
serrnojr = ERRNOJR
If spid==-1 Then Do
str ='unable to spawn' parm.1', errno='serrno 'errnojr='serrnojr
str = _BPX_SHAREAS str
say str
return
End
'waitpid (spid) waitpid. 0'
xrc = waitpid.W_EXITSTATUS
If xrc\=0 Then Do
str =parm.1 'failed, exit status='xrc,
'signaled' waitpid.w_termsig,
'stopped' waitpid.w_stopsig
str = _BPX_SHAREAS str
say str
End
else,
do until readval < 4000
"read (pipein) buf 4000"
readval = retval
do while length(buf) > 0
parse var buf line '15'x buf
say line
end
end
return
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Scott Ford
Sent: 10 October 2014 18:55
To: [email protected]
Subject: Re: REXX syscall spawnp and IPCS
Steve:
Hard to help unless we see your Rexx code ?
Regards,
Scott
From: Steve Austin
Sent: Friday, October 10, 2014 10:30 AM
To: [email protected]
Hello,
I've run out of hammers trying to use REXX syscall spawnp to run a REXX that
drives IPCS in a child address space. IPCS is starting OK, but it does not
appear to be accepting the SYSTSIN cards I'm piping to it. My latest attempt
retrieves the input from the piped STDIN and queues it to the TSO stack in the
hope that when invoked IPCS will read them from there, but this is not
happening. Can IPCS be run in this way?
All I'm getting back at present is; BLS21001I IPCS for z/OS 01.13.00-0
Thanks
Steve
This e-mail message has been scanned and cleared by Postini / Google Message
Security and the UNICOM Global security systems. This message is for the named
person's use only. If you receive this message in error, please delete it and
notify the sender.
----------------------------------------------------------------------
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
This e-mail message has been scanned and cleared by Postini / Google Message
Security and the UNICOM Global security systems. This message is for the named
person's use only. If you receive this message in error, please delete it and
notify the sender.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN