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

Want to keep max n no of duplicates


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

New User


Joined: 22 Jun 2007
Posts: 42
Location: Chennai

PostPosted: Wed Dec 12, 2007 2:07 pm
Reply with quote

I have 1 file having 40 records.

File is like this:

Field1 Field2 Field3
:
:
:

I want the output that contains those records having same value of Field2 repeats maximum 30 times.

If Field2 = 1122 for 35 records and 3333 for rest 5 then the output file will contain 30 records containing Field2 = 1122 and 5 rest records.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Dec 12, 2007 6:16 pm
Reply with quote

ayansau,

Say you have a situation where key A, B, C & D has 10 records (4* 10 =40) each. Then how do you expect your O/P.
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: Wed Dec 12, 2007 10:40 pm
Reply with quote

ayansau,

If I understand what you want correctly (and I may not), you can use a DFSORT job like the following. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  SORT FIELDS=(8,6,CH,A)
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(8,6))
  OUTFIL OMIT=(81,8,ZD,GT,+30),BUILD=(1,80)
/*
Back to top
View user's profile Send private message
ayansau

New User


Joined: 22 Jun 2007
Posts: 42
Location: Chennai

PostPosted: Thu Dec 13, 2007 5:37 pm
Reply with quote

murmohk1 wrote:
ayansau,

Say you have a situation where key A, B, C & D has 10 records (4* 10 =40) each. Then how do you expect your O/P.


In this case all record should retain
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 Dec 13, 2007 10:42 pm
Reply with quote

ayansau,

Did the DFSORT job I supplied do what you wanted?
Back to top
View user's profile Send private message
ayansau

New User


Joined: 22 Jun 2007
Posts: 42
Location: Chennai

PostPosted: Fri Dec 14, 2007 12:07 pm
Reply with quote

is that iceman tool client specific?
Its giving "PARAMETER 'OVERLAY' IS UNIDENTIFIED"

Earlier I have used "INREC OVERLAY=(..." but not "OUTREC OVERLAY=(" in ICETOOL, It was working fine. But in ICEMAN its not passing in syntax check.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Dec 14, 2007 12:27 pm
Reply with quote

ayansau,
Quote:
Its giving "PARAMETER 'OVERLAY' IS UNIDENTIFIED"

Could you post your spool messages?
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: Fri Dec 14, 2007 10:10 pm
Reply with quote

Quote:
"PARAMETER 'OVERLAY' IS UNIDENTIFIED"


This is NOT a DFSORT message. You must be using some other product (perhaps it checks the syntax before it calls the sort product).

OVERLAY has been available with DFSORT since Dec, 2004.

Quote:
Earlier I have used "INREC OVERLAY=(..." but not "OUTREC OVERLAY=(" in ICETOOL, It was working fine. But in ICEMAN its not passing in syntax check.


OVERLAY is a parameter available with DFSORT's INREC, OUTREC and OUTFIL statements. You can use these statements with DFSORT's ICETOOL in xxxxCNTL data sets. I assume that's what you mean when you say it was working fine with ICETOOL. But it doesn't make sense that you could use OVERLAY with DFSORT's ICETOOL and not with DFSORT itself. It appears that when you specify PGM=ICEMAN, you get some other program, not DFSORT whereas when you specify PGM=ICETOOL, you get DFSORT's ICETOOL. I can't really figure this out for you since I don't know how your shop has things set up.
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 How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
No new posts COUNT the number of duplicates DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. SUM FIELDS=NONE in reverse - Get dupl... DFSORT/ICETOOL 9
Search our Forums:

Back to Top