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

Need a SORT job


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

New User


Joined: 05 Feb 2007
Posts: 61
Location: Chennai

PostPosted: Thu Mar 27, 2008 10:58 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 27, 2008 7:29 pm
Reply with quote

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
View user's profile Send private message
hariibm

New User


Joined: 05 Feb 2007
Posts: 61
Location: Chennai

PostPosted: Thu Mar 27, 2008 9:49 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Mar 27, 2008 10:11 pm
Reply with quote

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
View user's profile Send private message
hariibm

New User


Joined: 05 Feb 2007
Posts: 61
Location: Chennai

PostPosted: Tue Apr 01, 2008 8:35 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Apr 01, 2008 8:59 pm
Reply with quote

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
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top