IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem Using Splice!!


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue May 16, 2006 6:31 pm
Reply with quote

Hi,

I am using SPLICE operator to solve the task as explained with the help of below example.

Code:

INPUT DATA
100345   92   78
100345   91   77
100345   90   76
100345   89   75
101455   95   65
101455   94   64
101455   93   83
101455   92   82


Code:

OUTPUT DATA should be!!!
100345   92   78
100345   92   78
100345   92   78
100345   92   78
101455   95   65
101455   95   65
101455   95   65
101455   95   65



ie I have a key , till the key is same, the first row of that
key should get spiced on the rest of the records till the key matches..

I am using the below

SPLICE FROM(UT01) TO(T1) - //where T1 is a temporary file.
ON(1,6,ZD) - (also tried ON(1,6,CH)
KEEPBASE -
WITHALL WITH(10,2) WITH(15,2)

The Input file & Output files are fixed bloxk & Having LREC as 80 ,

But I am not getting the desired result.
Any suggestions would be of great help.

Thankzzz
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 16, 2006 8:38 pm
Reply with quote

You have the WITH fields wrong. The WITH fields indicate the bytes you want from the overlay (second) record. So WITH(10,2) WITH(15,2) gives you bytes 10-11 and 15-16 from the overlay record - for the first pair of records, that's 91 and 77. You actually want bytes 10-11 and 15-16 from the base (first) record.

You essentially want to keep the entire base record each time you have a match. To do that, you can use WITH(1,6) so bytes 1-6 will be taken from the overlay (second) record and bytes 10-11 and 15-16 will be taken from the base (first) record. So your SPLICE statement should be:

Code:

SPLICE FROM(UT01) TO(T1) - 
  ON(1,6,ZD) -               
  KEEPBASE -                   
  WITHALL WITH(1,6)           


I'd suggest reading through the SPLICE documentation again paying particular attention to the concept of the base record and overlay record.
You can find the DFSORT SPLICE doc at:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/6.13?DT=20050222160456
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue May 16, 2006 10:31 pm
Reply with quote

Thanks Frank for your reply..
The correction you made did worked but,

If my Input was:

Code:

INPUT
100345   92   78  98   ABC
100345   91   77  97   DEF
100345   90   76  96   HIJ
100345   89   75  95   KLM
101455   95   85  58   AAA
101455   94   84  57   BBB
101455   93   83  56   CCC
101455   92   82  55   DDD



The correction you suggested will make my output as follows

Code:

100345   92   78    ABC
100345   92   78    ABC
100345   92   78    ABC
100345   92   78    ABC
101455   95   85    AAA
101455   95   85    AAA
101455   95   85    AAA
101455   95   85    AAA


But My OUTPUT should be

Code:

100345   92   78    ABC
100345   92   78    DEF
100345   92   78    HIJ
100345   92   78    KLM
101455   95   85    AAA
101455   95   85    BBB
101455   95   85    CCC
101455   95   85    DDD


That is My rest of the data should not change, it should remain as it is.

Thanks.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed May 17, 2006 2:32 am
Reply with quote

(Since you said "rest of the data should not change, it should remain as it is", I'm assuming you really don't want to drop the fourth field shown in your input file, but not in your output file.)

Did you read what I said about the base and overlay records?

Use a WITH operand for any fields you want from the overlay (second) record. For example, if you want positions 19-26 from the overlay record, add WITH(19,8). If you want positions 19-80 from the overlay record, add WITH(19,62). Just figure out what positions you need from the overlay record and add an appropriate WITH operand for them.

And please, the next time you want to know how to do something, describe what you want to do in detail. It's very frustrating, when you say "I want to do this" and I show you how, and then you say "but I really wanted to do that and you only showed me how to do this". I can't read your mind.
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Wed May 17, 2006 5:05 pm
Reply with quote

Thanks Frank for your valuable suggestions.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
Search our Forums:

Back to Top