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

Two Sort with duplicate removal in one step


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

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Tue Sep 01, 2009 7:23 pm
Reply with quote

Hi,

I have to sort a file based on one key and remove the duplicated using another key.
First sort the file using the below key:
Code:
SORT FIELDS=(1,15,CH,A,26,4,CH,A,23,2,CH,A,20,2,CH,A)


Then remove the duplicate records using the below key:
Code:
SORT FIELDS=(1,15,CH,A)
SUM FIELDS=NONE       


I can acheive this using two steps in JCL, but i was looking if both the things are possible in single JCL step.

Please Help, Thanks
Nirmal
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 01, 2009 8:44 pm
Reply with quote

kedarinirmal,

Assuming you input has an lrecl of 80 bytes and is of FB recfm , use the following control cards which will give you the desired results
Code:

//SYSIN    DD *                                               
  SORT FIELDS=(1,15,CH,A,26,4,CH,A,23,2,CH,A,20,2,CH,A),EQUALS
  OUTFIL REMOVECC,NODETAIL,SECTIONS=(1,15,HEADER3=(1,80))     
/*
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Tue Sep 01, 2009 9:05 pm
Reply with quote

Thanks a lot,
Its working fine....
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 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 Duplicate transid's declared using CEDA CICS 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
Search our Forums:

Back to Top