Query regarding WITHALL WITHEACH



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

Re: Query regarding WITHALL WITHEACH

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

Hello Billy Sir! I've posted what my exact expected output is? Which is same as the definition of WITHEACH & WITHALL says?
Please check the link of manual: http://publib.boulder.ibm.com/infocente ... 00/spl.htm

I am doing somewhat same as the manual is doing with WITHEACH & WITHALLL. Could you please tell me that if i am deviating from the actual definition?
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 porwalrox » Sat Oct 27, 2012 5:58 pm

Sorry BillyBoyo! I'll be able to post ICE201I message on monday only.
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 porwalrox » Mon Oct 29, 2012 11:33 am

Hi Billy!
ICE201I message is

ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
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 » Mon Oct 29, 2012 1:17 pm

OK, thanks, that is pretty up-to-date.

It looks like you are investigating the SPLICE to understand how it operates?

I'd suggest while doing this, you put your "fields-involved-in-SPLICE" "out-of-the-way" of existing data - I put mine at 30, 40, 50 with your data.

I think the thing is, you've missed something with WITHEACH, I think.

WITHEACH is working with "pairs" from a set of duplicates and will deal with all pairs in a duplicate to create one record, BUT those output records can only, from SPLICE itself, contain data from the two records in the pair. As well, the WITH that you give relates, on a "positional" basis, to the pair concerned. Your first WITH is for the first pair of records, your second for the second pair of records, etc. Note that for WITHEACH, "blanks" in the field on the second of the pair will overwrite data from the first of the pair.

For WITHALL, you get multiple records for pairs, one fewer than the number of records. Again, the content of the second in the pair which is defined in a WITH overwrites the content of the first in the pair.

You have to read the whole section on SPLICE, you have to work through the examples and your own examples.

Often there will be other ways of doing what you want for which you've initially thought of using SPLICE.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Query regarding WITHALL WITHEACH

Postby porwalrox » Mon Oct 29, 2012 3:35 pm

Hi Billy! Now i'm more confused. In WITHEACH first record is treated as a base reocrd and subsequent records overwrite the base record.
After processing the INREC, First 3 records will be like this
ID1 N5
ID1    N2
ID1       N8

If i do splicing with WITHEACH according to the manual, output should be like this
ID1       N8

if i got your point correctly, output will be the same as above. But manual tells it will be
ID1 N5 N2 N8

& moreover, the output is coming all the blanks like


You are right that i am doing some investigation only because of i'm not able to get the working of WITHEACH at all.
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 » Mon Oct 29, 2012 4:12 pm

Note that in the manual example, none of the field retained in the "base" record are specified in a WITH. Your example is different.

You are "losing" the field from the first record of a group (the base record) because you specify it in a WITH, so the data at that point will come from a duplicate record, containing space at the time.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Query regarding WITHALL WITHEACH

Postby porwalrox » Mon Oct 29, 2012 4:58 pm

BillyBoyo Thanks a lot!

I misinterpreted a very important line in WITHEACH. The first WITH field specifies the bytes to be overlaid from the second duplicate record on to the first duplicate record. The second WITH field specifies the bytes to be overlaid from the third duplicate record on to the first duplicate record, and so on.
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 » Mon Oct 29, 2012 5:41 pm

Glad it helped.

Much of what used to be done with SPLICE before JOINKEYS and WHEN=GROUP became available no longer needs to be done with SPLICE.

To my mind, it is the most complicated of ICETOOL's functions. I'd even say the "only" complicated one :-)

EDIT: Have a look here, for example...

http://ibmmainframes.com/about58321.html#293357

These users thanked the author BillyBoyo for the post:
porwalrox (Mon Oct 29, 2012 8:49 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post