MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
enge Beginner Joined: 12 Oct 2004 Posts: 78 Topics: 39
Posted: Wed Nov 19, 2014 4:46 am Post subject: Separate Unique and Duplicate Records
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
sortin dataset 2
sortout dataset 1
sortout dataset 2
thanks a lot
Back to top
William Collins Supermod Joined: 03 Jun 2012 Posts: 437 Topics: 0
Posted: Wed Nov 19, 2014 5:28 am Post subject:
Which SORT product are you using?
Back to top
enge Beginner Joined: 12 Oct 2004 Posts: 78 Topics: 39
Posted: Wed Nov 19, 2014 5:45 am Post subject:
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
enge Beginner Joined: 12 Oct 2004 Posts: 78 Topics: 39
Posted: Wed Nov 19, 2014 7:54 am Post subject:
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
Back to top
William Collins Supermod Joined: 03 Jun 2012 Posts: 437 Topics: 0
Posted: Wed Nov 19, 2014 8:58 am Post subject:
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Wed Nov 19, 2014 12:02 pm Post subject:
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
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