Sort Functionality



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Sort Functionality

Postby Devarati » Tue Jul 14, 2009 4:25 pm

Hi,

I have a query on SORT in JCL. This goes as below:

I have on I/P file whach have some records and can have unique entries as well as duplicates. I want to sort the file to get two O/P files - one will have the unique entries and the other will have the duplicate entries. How do I do that using SORT utility in JCL? Can it be done in one step of SORT? Please help....

I give an example for that:

I/P File:
----------

a
a
b
c
d
d
e
f
f

O/P File (unique entries):
-----------------------------
b
c
e

O/P File (duplicate entries):
---------------------------------
a
a
d
d
f
f

How do I do that??????

Thanks in advance,
Devarati
Devarati
 
Posts: 1
Joined: Tue Jul 14, 2009 4:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Functionality

Postby Frank Yaeger » Tue Jul 14, 2009 8:12 pm

Here's a DFSORT/ICETOOL job that will do what you asked for:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT1 DD DSM=...  output file1
//OUT2 DD DSM=...  output file2
//TOOLIN DD *
SELECT FROM(IN) TO(OUT1) DISCARD(OUT2) ON(1,1,CH) NODUPS
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post