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

Suggestion: DISCARD option for SPLICE


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

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Wed Sep 24, 2008 6:19 pm
Reply with quote

The title says it all, I hope..?

- Claes
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Wed Sep 24, 2008 7:48 pm
Reply with quote

no it doesn't.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Wed Sep 24, 2008 7:57 pm
Reply with quote

If you know SELECT... DISCARD, I think it does...
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Wed Sep 24, 2008 8:05 pm
Reply with quote

Do we need to talk in this encrypted language icon_question.gif

You can use splice with OUTFIL in certain cases to get what you want. But I don't know what you want icon_wink.gif
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Wed Sep 24, 2008 8:11 pm
Reply with quote

Ok... Even though you do seem to know what I want, here goes:

I would like a DISCARD(dsname) option for SPLICE, so I can route the discarded records of the SPLICE process to a dataset. Very similar to how the SELECT ... DISCARD works.

Hope that helps.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Wed Sep 24, 2008 8:54 pm
Reply with quote

Your question still leaves many possibilities.

SPLICE generally drops the base records from output unless KEEPBASE is specified. So do you want to get base records in a separate DS?

SPLICE drops the unique records from output unless KEEPNODUPS is specified. So do you want to get these records in a separate DS?

SPLICE merges(or splices) multiple records in to a single record. It is not "discarding the records" to be accurate.

With select it is a different game all together. It has one to one relation with output.

It would help if you can post your full requirement. It will be even better if you can post some sample data.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Wed Sep 24, 2008 11:22 pm
Reply with quote

Consider this:

SPLICE FROM(IN) TO(OUT) ON(..) WITH(..) DISCARD(dsname)

What I mean is that the DISCARD-ds should contain IN "minus" OUT, that is: All the records from IN that is not in OUT, would be in DISCARD (as it is true with SELECT ... DISCARD).

Sorry, that I thought this was obvious.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Wed Sep 24, 2008 11:24 pm
Reply with quote

Note: KEEPBASE and KEEPNODUPS has no effect on this, as the records that fulfill these will be in OUT.
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 Sep 24, 2008 11:57 pm
Reply with quote

I don't think it's obvious at all what you mean.

SPLICE combines records so it isn't clear to me what you mean by "All the records from IN that is not in OUT".

If I use SPLICE with WITHALL and WITH for FIELD1 for these records:

Code:

BASE     FIELD1
OVERLAY1        FIELD2
OVERLAY2        FIELD2
OVERLAY3        FIELD2


The output records are:

Code:

OVERLAY1 FIELD1 FIELD2
OVERLAY2 FIELD1 FIELD2
OVERLAY3 FIELD1 FIELD2


None of the records from IN are in OUT. The output records are a combination of the base and overlay records. Which record do you consider from IN that's not in OUT? All of the original input records? Just the base record? Why? What are the rules?

How about the situation where I use SPLICE with WITHEACH and WITH for FIELD2 and FIELD3 for these records:

Code:

BASE     FIELD1
OVERLAY1        FIELD2
OVERLAY2               FIELD3


The output record would be:

Code:

OVERLAY2 FIELD1 FIELD2 FIELD3


None of the records were discarded - they were combined. So again what would you want in DISCARD? Why? What are the rules?

Or are you talking about a different situation? What situation? What are the rules?

Perhaps if you gave a concrete example of what you want to use DISCARD for with input and output records, it would clarify what you want to do.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 25, 2008 4:54 am
Reply with quote

Hi Frank,

I think I know what Claes is trying to say

Here is an example

Code:
//S1       EXEC PGM=ICETOOL                           
//TOOLMSG  DD SYSOUT=*                                 
//DFSMSG   DD SYSOUT=*                                 
//IN       DD *                                       
Z1                                                     
A1                                                     
A2345678                                               
B2345678                                               
/*                                                     
//OUT      DD SYSOUT=*                                 
//TOOLIN   DD *                                       
 SPLICE FROM(IN) TO(OUT) ON(1,1,CH) -                 
   WITH(4,5)                                           


Output looks like this
Code:
A1 45678



What Claes is after is Z & B records in a separate file.


Gerry
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: Thu Sep 25, 2008 5:31 am
Reply with quote

Gerry,

Those would be the nodup records. That may or may not be what Claes had in mind, but I'd like him to tell us what he wants. (If that's all he wants, then he should have said that in the first place to avoid having us guess.)

Note that a further complication of this would be if the records came from two different files in which case there could be nodup records from both files which would go to DISCARD which may or may not be what's wanted.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue Oct 14, 2008 6:19 pm
Reply with quote

Gerry is right - I in fact wanted the NODUPS records in a separate file. I case of two or more input files, this situation should be treated as one file. In case it doesn't make sense, let's just forget about it.

Meanwhile, I apologize for wasting everybodies time icon_sad.gif And I promise you all that next time I will think everything better through, before I submit a suggestion!

/Claes
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 SCOPE PENDING option -check data DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts CICS vs LE: STORAGE option CICS 0
No new posts INSYNC option with same function as I... JCL & VSAM 0
Search our Forums:

Back to Top