View previous topic :: View next topic
|
Author |
Message |
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
I have used DFSORT SPLICE for one of my requirements.
I am getting the results as below.
If there is no base record for a particular key, I am getting only one overlay record spliced(others are eliminated from the output).
If there are more than one base records for a particular key, I am getting only one overlay record spliced and also one base record.
I need the results as below:
If there is no base record for a particular key, I should get all the overlay records in the output and spaces for the positions where the base record should have values in the output.
If there are more than one base records for a given key, I should get all the overlay records in the output. And for the Base record positions in the output file, i should get the values from the first base record(since there are more than one base records for a given key). And I should not get any base record
Please let me know with which options I can handle this.
Note: I am just using the KEEPNODUPS option with my SPLICE operand(except WITHALL and WITH) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post some example input and output data that demonstrate your situation as well as the jcl and control statements for this process. |
|
Back to top |
|
|
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
As in my first example,
If I have a data like this.. in the input file,
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+
-------- PART 01232K01121{03051AZZZZ-------------
-------- PART 01232B01421A09011AXXXX-------------
-------- PART 01122{08015{01021AMMMM-------------
-------- PART 01122{08015{01021AMMMM-------------
++++++++ NAME ZZZZHARI 4
++++++++ NAME XXXXRAMU 2 |
The output I am getting is like below..
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+---
-------- PART 01232K01121{03051AZZZZ-------------HARI
-------- PART 01232B01421A09011AXXXX-------------RAMU
-------- PART 01122{08015{01021AMMMM------------- |
The part number MMMM is appearing twice in the input file.. For this part there is no 'NAME' record.
So, I am getting only one record in the output for the part MMMM.
I am using this below SPLICE command.
SPLICE FROM(IN) TO(OUT) ON(48,4,CH) WITHALL KEEPNODUPS -
WITH(5,60)
I am using the 'NAME' record as the base and 'PART as the overlay records.
Please let me know how what changes can be done in SPLICE to get all the records of PART(overlay) if there is no part 'NAME'(base record) reocrd exists for a given key. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you go back to the example I showed, you'll see I have the KEEPBASE operand for the SPLICE operator. It's missing from your SPLICE operator.
You need KEEPBASE to keep the first duplicate without a match.
If adding KEEPBASE doesn't give you what you want, then show me your complete ICETOOL job. |
|
Back to top |
|
|
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
Hi Frank,
Atlast my problem got resolved.
Thanks a lot for the solution.
I have a question about the base and overlay records.
As I understood, the base records are assumed as NAME records and overlay records as PART records.
My question is how does the SPLICE command consider the base records as NAME and overlay records as PART records. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The SPLICE command treats the first record of a set of duplicates as the "base" record and the second (and subsequent)
record(s) of a set of duplicates as the "overlay" record(s). So we just had to set things up so the NAME records were first. |
|
Back to top |
|
|
|