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 

Selective Count in Sort

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


Joined: 07 Aug 2007
Posts: 9
Topics: 3

PostPosted: Mon Jan 14, 2008 2:54 am    Post subject: Selective Count in Sort Reply with quote

Hello All,
I have a requirement as below

File 1

Code:

Rec no            Col1          Col2
     1            AAAAA         CL
     2            AAAAA         CL
     3            AAAAA         CL
     4            BBBBB         CL
     5            BBBBB         CL
     6            CCCCC         CL
     7            CCCCC         CL
     8            CCCCC         CL
     9            DDDDD         CL
     10           DDDDD         CL


The requirement is to Omit all records which have more than 2 occurrences from the input file. For example my output here should have.

Code:

BBBBB     CL
DDDDD     CL


Your response in this regard would be much appreciated.

thanks
Anand
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Jan 14, 2008 5:04 am    Post subject: Reply with quote

This is basically the same requirement as this topic.
http://www.mvsforums.com/helpboards/viewtopic.php?t=9395

The same comments apply. I presume it is homework. Also, you mention COUNT in the title but no clue as to what you want counted in your post.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Mon Jan 14, 2008 11:25 am    Post subject: Reply with quote

Anand,

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed you wanted to check for duplicates on col1 and col2. If you only want to check on col1, then remove the ON(33,2,CH) operand from each SELECT statement.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD *
     1            AAAAA         CL
     2            AAAAA         CL
     3            AAAAA         CL
     4            BBBBB         CL
     5            BBBBB         CL
     6            CCCCC         CL
     7            CCCCC         CL
     8            CCCCC         CL
     9            DDDDD         CL
     10           DDDDD         CL
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(19,5,CH) ON(33,2,CH) LOWER(3)
SELECT FROM(T1) TO(OUT) ON(19,5,CH) ON(33,2,CH) FIRST USING(CTL1)
/*

_________________
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
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