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

Eliminatig records using DF sort


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

New User


Joined: 08 Aug 2005
Posts: 9

PostPosted: Sun Nov 05, 2006 3:22 pm
Reply with quote

Hi

I having a file of 1ength 220 .My Input file is as like below

Code:

field1      field2
123         657
123         456
321         234
321         435
143         222
567         888


And i want my output file as

Code:

field1      field2
123         657
321         435
143         222
567         888




ie , first i want to sort field1 and if field1 has duplicates i want to elimate records based on the field 2 value ie, i want the record which has highest value in field2

can u suggest a way for doing this???
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: Sun Nov 05, 2006 9:43 pm
Reply with quote

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

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,3,ZD) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,3,ZD,A,13,3,ZD,D)
/*
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 5
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top