One way you could do this is to write the data/control statements out to a file 
and then let ndmcli read them from that file

x = lineout("ndm-cntrl.txt", "submit unc0001o process snode=Z9NNODE")
x = lineout("ndm-cntrl.txt","pend ;")
"ndmcli -x <ndm-cntrl.txt  2>&1 | rxqueue ndm.out /FIFO"

which basically setups the ndmcli program to read the control statements from 
the file ndm-cntrl.txt (which was created in the first two lines), the output 
and the error output of the ndmcli program are piped to the rxqueue program 
which put the output on the rexx queue ndm.out

This is the bare bones of the program.  You probably want to spend more time 
bullet proofing the program.  For example you may want to use the stream 
commands to explicitly open and close the ndm-cntrl.txt file.   you may want to 
check that it exists or doesn't exist depending on your program logic.  You may 
want to make the file a permanent control card input to your rexx program and 
not recreate it each time. You can read the output of the ndmcli program from 
the named rexx queue ndm.out

 
On Sep 12, 2013, at 2:06 PM, pr gramly wrote:

> i am converting a bash script to ooRexx and am not sure how to handle
> the redirection that is used in the original in ooRexx.
> 
> so the shell script is something like this:
> #!/bin/sh
> set -v
> ndmcli  -x << EOJ
> submit unc0001o process snode=Z9NNODE
> pend ;
> EOJ
> 
> the script invokes the ndmcli program and uses the combination of 
> set -v 
> i.e. "print lines of shell as they are read"  which i think sends them
> to STDOUT
> 
> and the
> << EOJ 
> 'here document' to pass the lines to ndmcli
> 
> so here is my ooRexx version:
> 
> #!/usr/bin/rexx
> /* __ ooRexx __ */
> 
> "ndmcli  -x << EOJ"               -- invoke NDM cmd line, & pass PROC stmnts
> say 'submit unc0001o process snode=Z9NNODE                                    
>  '
> say 'pend ;                                                                   
>  '
> say 'EOJ'
> 
> Exit
> 
> SAY writes to STDOUT so i thought it would work the same, but instead i
> get an error:
> 
> sh: warning: here-document at line 0 delimited by end-of-file (wanted 'EOJ')
> 
> so how do i pass a group of lines to another program?
> 
> i looked at queuing them all up on the external data queue and using
> LINEOUT but it writes to STDOUT as well.
> 
> what am i missing here?
> 
> Phillip
> 
> 
> 
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. Consolidate legacy IT systems to a single system of record for IT
> 2. Standardize and globalize service processes across IT
> 3. Implement zero-touch automation to replace manual, redundant tasks
> http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
> _______________________________________________
> Oorexx-users mailing list
> Oorexx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-users


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to