Page 1 of 2

Query regarding WITHALL WITHEACH

PostPosted: Thu Oct 25, 2012 5:54 pm
by porwalrox
My input file:
ID1 POS1 N5 COMMENT1
ID1 POS2 N2 COMMENT1
ID1 POS3 N8 COMMENT1
ID2 POS1 N3 COMMENT2
ID2 POS3 N9 COMMENT2
ID3 POS1 N0 COMMENT3
ID3 POS2 N7 COMMENT3
ID4 POS3 N6 COMMENT4
ID5 POS2 N3 COMMENT5
ID5 POS3 N8 COMMENT5
ID6 POS2 N4 COMMENT6


If i use
SPLICE FROM(IN1) TO(OUT) ON(1,3,CH) WITH(5,2) WITH(8,2) WITH(11,2)-
WITHEACH KEEPNODUPS USING(CTL1)                                   

output is:
ID1          COMMENT1
ID2          COMMENT2
ID3          COMMENT3
ID4       N6 COMMENT4
ID5    N3    COMMENT5
ID6    N4    COMMENT6


Why N5, N3 and N0 is not coming in the ID1, ID2 and ID3?
& if I use
SPLICE FROM(IN1) TO(OUT) ON(1,3,CH) WITH(5,2) WITH(8,2) WITH(11,2)-
WITHALL KEEPNODUPS USING(CTL1)                                     

Output:
ID1    N2    COMMENT1
ID1       N8 COMMENT1
ID2       N9 COMMENT2
ID3    N7    COMMENT3
ID4       N6 COMMENT4
ID5       N8 COMMENT5
ID6    N4    COMMENT6

Why again N5,N3,N0 is not coming in ID1,Id2,ID3?

Re: Query regarding WITHALL WITHEACH

PostPosted: Thu Oct 25, 2012 7:53 pm
by dick scherrer
Hello,

What is in CTL1?

Re: Query regarding WITHALL WITHEACH

PostPosted: Fri Oct 26, 2012 12:13 pm
by porwalrox
Sorry due to some connectivity issue! i couldn't reply.
My CTL1 is
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=(8,1,ZD,EQ,1),BUILD=(1,3,5:10,2,14:13,8)),
IFTHEN=(WHEN=(8,1,ZD,EQ,2),BUILD=(1,3,8:10,2,14:13,8)),
IFTHEN=(WHEN=(8,1,ZD,EQ,3),BUILD=(1,3,11:10,2,14:13,8))
/*

Re: Query regarding WITHALL WITHEACH

PostPosted: Fri Oct 26, 2012 5:12 pm
by BillyBoyo
Can you show your expected output, and describe what you are trying to do.

Re: Query regarding WITHALL WITHEACH

PostPosted: Sat Oct 27, 2012 10:50 am
by porwalrox
For SPLICE FROM(IN1) TO(OUT) ON(1,3,CH) WITH(5,2) WITH(8,2) WITH(11,2)-
WITHEACH KEEPNODUPS USING(CTL1)


My expected output is:
ID1 N5 N2 N8 COMMENT1
ID2 N3    N9 COMMENT2
ID3 N0 N7     COMMENT3
ID4       N6 COMMENT4
ID5    N3 N8 COMMENT5
ID6    N4    COMMENT6


For SPLICE FROM(IN1) TO(OUT) ON(1,3,CH) WITH(5,2) WITH(8,2) WITH(11,2)-
WITHALL KEEPNODUPS USING(CTL1)


My expected output is:
ID1 N5 N2    COMMENT1
ID1 N5    N8 COMMENT1
ID2 N3    N9 COMMENT2
ID3 N0 N7    COMMENT3
ID4       N6 COMMENT4
ID5    N3 N8 COMMENT5
ID6    N4    COMMENT6

Re: Query regarding WITHALL WITHEACH

PostPosted: Sat Oct 27, 2012 12:13 pm
by BillyBoyo
So try WITHANY.

Re: Query regarding WITHALL WITHEACH

PostPosted: Sat Oct 27, 2012 3:51 pm
by porwalrox
If i use WITHANY, it works fine for first situation. But I'm not getting, why this is happening?
& for second case WITHANY doesn't work.

Re: Query regarding WITHALL WITHEACH

PostPosted: Sat Oct 27, 2012 5:06 pm
by BillyBoyo
You have one other option, which is not to use any of them. If that doesn't "work" then what you want can't be done with SPLICE (at least not with one pass of the data).

If you set out exactly what you want, there might be suggestions for other ways to do it.

Read the description of the SPLICE options in the manual, and test them out to make sure you fully understand them anyway.

Re: Query regarding WITHALL WITHEACH

PostPosted: Sat Oct 27, 2012 5:22 pm
by porwalrox
I have read the manual already. After that i'm discussing this issue with you. What I've done for the second case that is same as the manual talks about. But i'm receiving different output rather than expected output.
I have read the manual about WITHEACH & WITHANY. It is almost same but when i use WITHEACH instead of WITHANY. It doesn't work. Could you please help me, if i am wrong somewhere?

Re: Query regarding WITHALL WITHEACH

PostPosted: Sat Oct 27, 2012 5:38 pm
by BillyBoyo
As far as I can see, and I tried your code, with your data, and modified it slightly repeated your results, SPLICE can't do what I "think" you want from what you have shown. I didn't try the default, but I don't think that'll get it for you either.

If you can describe exactly what you want, and illustrate it fully with sample input and required output, we can confirm whether or not in can be done with SPLICE in one pass, or whether there is another way it can be done using DFSORT/ICETOOL.

Please post the ICE201I message from a Sort step?