I've written a rexx pipe stage that I want to read an input record and selectively write to either the primary output stream, or the secondary if connected. I also want it to work with the NOT stage, and therein lies my problem. Here's my (simplified) rexx stage:
/**/ trace o
parse arg test_value .
'STREAMSTATE OUTPUT 1'
secondary = (wordpos(rc,'0 4 8') > 0)
signal on error
do forever
'PEEKTO input_record' /* Peek at the input record */
if input_record = test_value then /* Simplistic */
do
'SELECT OUTPUT 0'; 'OUTPUT' input_record
end
else
if secondary then
do
'SELECT OUTPUT 1'; 'OUTPUT' input_record
end
'READTO' /* Consume the input record */
end
Error:
exit 12*(rc<>12)
Now some tests...
Multi-stream:
pipe(end ?) literal x y | split | t: test x | specs /Pri/ 1 1-* nw|cons ?
t: | specs /Sec/ 1 1-* nw | cons
Pri x
Sec y
Ready; T=0.01/0.01 08:35:42
That's what we expected!
Multi-stream with NOT:
pipe(end ?) literal x y | split | t: NOT test x | specs /Pri/ 1 1-* nw|cons ?
t: | specs /Sec/ 1 1-* nw | cons
Sec x
Pri y
Ready; T=0.01/0.01 08:35:47
No surprise here either!
Single-stream:
pipe(end ?) literal x y | split | test x | specs /Pri/ 1 1-* nw|cons
Pri x
Ready; T=0.01/0.01 08:35:51
Still good!
Single-stream with NOT:
pipe(end ?) literal x y | split | NOT test x | specs /Pri/ 1 1-* nw|cons
Ready; T=0.01/0.01 08:35:55
Not really a surprise, but how??
Mark Wheeler
UnitedHealth Group
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your
inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
