Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Two Sort with duplicate removal in one step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Two Sort with duplicate removal in one step
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    Post subject: Reply to: Two Sort with duplicate removal in one step
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    Post subject:
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    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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us