Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Suggestion: DISCARD option for SPLICE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Suggestion: DISCARD option for SPLICE
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Sep 24, 2008 11:57 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Sep 25, 2008 4:54 am    Post subject:
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 Moderator


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

PostPosted: Thu Sep 25, 2008 5:31 am    Post subject:
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    Post subject:
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    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 DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts DB2 SQL help/idea/suggestion bshkris DB2 4 Thu Oct 06, 2016 3:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us