On Wed, 20 May 2020 14:56:39 -0500, J Ellis <[email protected]>
wrote:
>i would like to use the bpxwunix function to run, either HOST or DIG or
>nslookup commands, seems pretty straightforward ...
>but I can not get the put to com back to me, it has to be something silly i am
>overlooking, any help would be appreciated
>
>/* rexx */
>say 'hostname running'
>RC = SYSCALLS('ON')
>If RC<0 | RC>4 Then Exit RC
>address TSO 'Execio * Diskr input (STEM ipaddr. finis'
>Address SYSCALL
> Do i = 1 to ipaddr.0
> call bpxwunix 'host ',ipaddr.i,out.
> say 'inaddr ' ipaddr.i
> say 'out ' out.
> Address tso
> 'Execio 1 Diskw ddout (STEM out. '
> End
> "EXECIO 0 DISKW ddout (FINIS)"
> Exit
A refactoring (untested). See:
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.bpxb600/wunix.htm
/* rexx */
say 'hostname running'
RC = SYSCALLS('ON')
If RC<0 | RC>4 Then Exit RC
empty.0 = 0 /* Empty stdin stem. */
address TSO 'Execio * Diskr input (STEM ipaddr. finis'
Do i = 1 to ipaddr.0
call bpxwunix 'host 'ipaddr.i '2>&1', , /* Redirect stderr to stdout. */
'empty.', 'out.'
say 'inaddr ' ipaddr.i
say 'out lines' out.0
Address tso
'Execio' out.0 'Diskw ddout (STEM out.)' /* Print all lines if more than 1.
*/
End
"EXECIO 0 DISKW ddout (FINIS)"
Exit
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN