Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem Using Splice!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Problem Using Splice!!
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 Moderator


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

PostPosted: Tue May 16, 2006 8:38 pm    Post subject:
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:

http://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    Post subject: Re: Problem Using Splice!!
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 Moderator


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

PostPosted: Wed May 17, 2006 2:32 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us