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 

SUM FIELDS=NONE needed to remove dups?

 
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
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Jul 05, 2012 11:20 am    Post subject: SUM FIELDS=NONE needed to remove dups? Reply with quote

I have the below JCL where I like to know if I need to add SUM FIELDS = NONE to remove dups?.
Someone told me that SORT Fields and Sum fields cannot exist in the same Cntlcard.
Thx for your time.

Code:

//SORTSTEP EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSLIST  DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//SORTJNF1 DD DISP=SHR,DSN=NVDB.OLOADFIL
//SORTJNF2 DD DISP=SHR,DSN=NVDX.VNUNLOAD 
//SORTOUT  DD DSN=ICZ38X.NVDXTDN.TESTSTAT,         
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
//            DCB=(RECFM=FB,LRECL=36,BLKSIZE=0),
//            SPACE=(TRK,(20,20),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
  JOINKEYS FILE=F1,FIELDS=(1,9,A)
  JOINKEYS FILE=F2,FIELDS=(1,9,A)
  JOIN UNPAIRED,F1,ONLY
  REFORMAT FIELDS=(F1:01,36)
  OMIT COND=(1,9,CH,EQ,C'000000000')
//
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jul 05, 2012 11:54 am    Post subject: Re: SUM FIELDS=NONE needed to remove dups? Reply with quote

vak255 wrote:
I have the below JCL where I like to know if I need to add SUM FIELDS = NONE to remove dups?.
Someone told me that SORT Fields and Sum fields cannot exist in the same Cntlcard.
Thx for your time.



Vak255,

Whoever that someone is, he/she has no idea what they are talking about. You CAN have SORT FIELDS and SUM FIELDS in the same sysin.

Assuming that you want to sort on the fields at pos 10 for 5 bytes then you can change SORT FIELDS=COPY to SORT FIELDS=(10,5,CH,A) and code SUM FIELDS=NONE which will remove the duplicates.

Try this
Code:

//SYSIN    DD *
  JOINKEYS FILE=F1,FIELDS=(1,9,A)
  JOINKEYS FILE=F2,FIELDS=(1,9,A)
  JOIN UNPAIRED,F1,ONLY
  REFORMAT FIELDS=(F1:01,36)
  OMIT COND=(1,9,CH,EQ,C'000000000')
  SORT FIELDS=(10,5,CH,A)
  SUM FIELDS=NONE
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Jul 05, 2012 1:16 pm    Post subject: Reply with quote

Thanks Kolusu.
You Rock
Back to top
View user's profile Send private message
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Fri Jul 06, 2012 7:54 am    Post subject: Reply with quote

Quote:
SUM FIELDS=NONE which will remove the duplicates.
And this will remove the dulicates for the keys mentioned in SORT FIELDS, yes?
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Jul 06, 2012 9:04 am    Post subject: Reply with quote

Yes.
_________________
All the best,

di
Back to top
View user's profile Send private message
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