Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Want to keep max n no of duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Want to keep max n no of duplicates
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: 1439
Location: Bangalore,India

PostPosted: Wed Dec 12, 2007 6:16 pm    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Dec 12, 2007 10:40 pm    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Dec 13, 2007 10:42 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Fri Dec 14, 2007 12:27 pm    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Dec 14, 2007 10:10 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts SORT CARD to remove duplicates & ... mkk157 DFSORT/ICETOOL 17 Tue Jul 08, 2014 9:04 pm
No new posts Remove the duplicates without sorting... maki_psg JCL & VSAM 13 Tue May 13, 2014 10:32 pm
No new posts Having issues removing duplicates thesumitk JCL & VSAM 8 Sat Apr 26, 2014 4:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us