MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sort Help

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Apr 28, 2004 12:51 am    Post subject: Sort Help Reply with quote

Hi,

My data looks like this.

260071311 FR 28.02.2004 PAYMNT
260071311 FR 28.02.2004 PAYMNT
261587935 FR 05.02.2004 PSA9A
261587935 FR 05.02.2004 PSA9A
261587935 FR 05.02.2004 PSA9A
261587935 FR 05.02.2004 PSA9A
261587935 FR 05.02.2004 PSA9A
261587935 FR 05.02.2004 PSA9A
261587935 FR 05.02.2004 PSA9A
264602186 FR 12.04.2004 SPAC
264602186 FR 07.04.2004 PSA2B
264602186 FR 22.03.2004 SPAC
264602186 FR 12.04.2004 SPAC
264602186 FR 07.04.2004 PSA2B
264602186 FR 22.03.2004 SPAC
264602186 FR 12.04.2004 SPAC
264602186 FR 07.04.2004 PSA2B
264602186 FR 22.03.2004 SPAC
264602186 FR 12.04.2004 SPAC
264602186 FR 07.04.2004 PSA2B
264602186 FR 22.03.2004 SPAC
264602186 FR 12.04.2004 SPAC
264602186 FR 12.04.2004 SPAC
264602186 FR 07.04.2004 PSA2B
264602186 FR 07.04.2004 PSA2B
264602186 FR 22.03.2004 SPAC

I need to eliminate the duplicates based on first 9 digits which starts from 1st position and based on date which starts from 14th position.

So, I need the output as

260071311 FR 28.02.2004 PAYMNT

261587935 FR 05.02.2004 PSA9A

264602186 FR 12.04.2004 SPAC
264602186 FR 07.04.2004 PSA2B
264602186 FR 22.03.2004 SPAC

How can I do this......
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 28, 2004 5:15 am    Post subject: Reply with quote

Phnai,

try these control cards
Code:

  OPTION EQUALS                             
  SORT FIELDS=(1,9,CH,A,14,10,CH,D)         
  SUM FIELDS=NONE                           


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Apr 28, 2004 10:13 am    Post subject: Reply with quote

Paneendra,

You can use the following DFSORT/ICETOOL job to do what you want:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
  SELECT FROM(IN) TO(OUT) ON(1,9,CH) ON(14,10,CH) FIRST
/*


Ravi,

With the SELECT operator of DFSORT's ICETOOL, FIRST will select the first record and LAST will select the last record. So in the example you show, you can use FIRST to get the AR record or LAST to get the FR record. The FIRSTDUP and LASTDUP parameters are also available to get the first duplicate record or the last duplicate record, respectively. For complete information on the SELECT operator of DFSORT's ICETOOL, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA00/6.11?DT=20031124143823
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Apr 29, 2004 11:58 pm    Post subject: Reply with quote

Hi All,
Thanks for your reply.

I used
SORT FIELDS=(1,9,ZD,A,14,10,CH,A)
SUM FIELDS=NONE

which gave me the required output.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group