View previous topic :: View next topic
|
Author |
Message |
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
The title says it all, I hope..?
- Claes |
|
Back to top |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
no it doesn't. |
|
Back to top |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
If you know SELECT... DISCARD, I think it does... |
|
Back to top |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
Do we need to talk in this encrypted language
You can use splice with OUTFIL in certain cases to get what you want. But I don't know what you want |
|
Back to top |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
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 |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
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 |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
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 |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
Note: KEEPBASE and KEEPNODUPS has no effect on this, as the records that fulfill these will be in OUT. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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
What Claes is after is Z & B records in a separate file.
Gerry |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
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 And I promise you all that next time I will think everything better through, before I submit a suggestion!
/Claes |
|
Back to top |
|
|
|