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 

Separate Unique and Duplicate Records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
enge
Beginner


Joined: 12 Oct 2004
Posts: 78
Topics: 39

PostPosted: Wed Nov 19, 2014 4:46 am    Post subject: Separate Unique and Duplicate Records Reply with quote

hello everyone,
is that possible ,in a sort (icetool e.g.), sorting 2 datesets as sortin... separate the records into 2 datasets as sortout where the first sortout dataset contains the records that have unique key ,meanwhile in the second sortout dataset contains those ones have duplicate keys?
for example:
sortin dataset 1
Code:

aaa
bbb
ccc

sortin dataset 2
Code:

bbb
ccc

sortout dataset 1
Code:
aaa

sortout dataset 2
Code:

bbb
ccc
bbb
ccc     

thanks a lot
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Wed Nov 19, 2014 5:28 am    Post subject: Reply with quote

Which SORT product are you using?
Back to top
View user's profile Send private message
enge
Beginner


Joined: 12 Oct 2004
Posts: 78
Topics: 39

PostPosted: Wed Nov 19, 2014 5:45 am    Post subject: Reply with quote

Code:

//SPGYBPD5  EXEC PGM=ICETOOL,COND=(0,NE)                     
 //SYSOUT    DD SYSOUT=*                                     
 //DFSMSG    DD SYSOUT=*                                     
 //TOOLMSG   DD SYSOUT=*                                     
 //IN1       DD DSN=§PRFSPI.GYBP1500.SORTN101,DISP=SHR       
 //          DD DSN=§PRFSPI.GYBP1500.SORTN102,DISP=SHR       
 //OUT1      DD DSN=§PRFSPI.GYBP1500.SORTS101,               
 //             DISP=(,CATLG,DELETE),                         
 //             UNIT=SYSDA,SPACE=(CYL,(015,005),RLSE),       
 //             DCB=(RECFM=FB,LRECL=1500,DSORG=PS)           
 //OUT2      DD DSN=§PRFSPI.GYBP1500.SORTS102,               
 //             DISP=(,CATLG,DELETE),                         
 //             UNIT=SYSDA,SPACE=(CYL,(015,005),RLSE),       
 //             DCB=(RECFM=FB,LRECL=1500,DSORG=PS)           
 //TOOLIN    DD *                                             
?????????
Back to top
View user's profile Send private message
enge
Beginner


Joined: 12 Oct 2004
Posts: 78
Topics: 39

PostPosted: Wed Nov 19, 2014 7:54 am    Post subject: Reply with quote

sorry for waste your time . i found out the solution..
Code:

//TOOLIN DD *
SELECT FROM(IN1) TO(OUT1) ON(265,12,CH) ALLDUPS           
SELECT FROM(IN1) TO(OUT2) ON(265,12,CH) NODUPS

bonk
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Wed Nov 19, 2014 8:58 am    Post subject: Reply with quote

You should look at the manual. You're reading all the data (and sorting) it twice with no need. It'll work, but client will pay extra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Nov 19, 2014 12:02 pm    Post subject: Reply with quote

enge,

You don't need 2 passes of data. You need to look at the parm DISCARD on the SELECT operator.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/7.14

Code:

//SPGYBPD5  EXEC PGM=ICETOOL,COND=(0,NE)                     
//DFSMSG    DD SYSOUT=*                                     
//TOOLMSG   DD SYSOUT=*                                     
//IN1       DD DISP=SHR,DSN=§PRFSPI.GYBP1500.SORTN101       
//          DD DISP=SHR,DSN=§PRFSPI.GYBP1500.SORTN102
//*
//OUT1      DD DSN=§PRFSPI.GYBP1500.SORTS101,               
//             DISP=(,CATLG,DELETE),                         
//             UNIT=SYSDA,SPACE=(CYL,(015,005),RLSE)
//*       
//OUT2      DD DSN=§PRFSPI.GYBP1500.SORTS102,               
//             DISP=(,CATLG,DELETE),                         
//             UNIT=SYSDA,SPACE=(CYL,(015,005),RLSE)
//*       
//TOOLIN    DD *                                             
  SELECT FROM(IN1) TO(OUT1) ON(265,12,CH) ALLDUPS DISCARD(OUT2)
//*       

_________________
Kolusu
www.linkedin.com/in/kolusu
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 -> Job Control Language(JCL) 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