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

writing max salary records


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

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Thu Jan 08, 2009 7:51 pm
Reply with quote

I have a flat file with below records...
record format is :

id number: 7 chars (eg: ABC0001)
technology:2 chars (eg: MF)
salary:5 chars (eg: 15000)

ABC0001MF15000
ABC0001HR25000
ABD0002DN15000
ABE0003MF20000
ABE0003HR12000

Now I want to write the record which has the maximum salary for particular id number. The output file should contain unique id numbers with maximum salary and corresponding technology.

The output file should have records like below:

ABC0001HR25000
ABD0002DN15000
ABE0003MF20000

Can you please suggest the way to do it?
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: Thu Jan 08, 2009 9:55 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 (FB/14)
//OUT DD DSN=...  output file (FB/14)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,7,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,7,CH,A,10,5,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 only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top