Query regarding WITHALL WITHEACH



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Query regarding WITHALL WITHEACH

Postby porwalrox » Thu Oct 25, 2012 5:54 pm

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?
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Query regarding WITHALL WITHEACH

 

Re: Query regarding WITHALL WITHEACH

Postby dick scherrer » Thu Oct 25, 2012 7:53 pm

Hello,

What is in CTL1?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Query regarding WITHALL WITHEACH

Postby porwalrox » Fri Oct 26, 2012 12:13 pm

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))
/*
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Query regarding WITHALL WITHEACH

Postby BillyBoyo » Fri Oct 26, 2012 5:12 pm

Can you show your expected output, and describe what you are trying to do.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Query regarding WITHALL WITHEACH

Postby porwalrox » Sat Oct 27, 2012 10:50 am

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
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Query regarding WITHALL WITHEACH

Postby BillyBoyo » Sat Oct 27, 2012 12:13 pm

So try WITHANY.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Query regarding WITHALL WITHEACH

Postby porwalrox » Sat Oct 27, 2012 3:51 pm

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.
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Query regarding WITHALL WITHEACH

Postby BillyBoyo » Sat Oct 27, 2012 5:06 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Query regarding WITHALL WITHEACH

Postby porwalrox » Sat Oct 27, 2012 5:22 pm

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?
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Query regarding WITHALL WITHEACH

Postby BillyBoyo » Sat Oct 27, 2012 5:38 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post