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 

Summing and removing duplicates using SORT

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


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Jun 17, 2005 3:50 am    Post subject: Summing and removing duplicates using SORT Reply with quote

My input file looks like this:

Code:

12345  1  2  3
12345  2  3  4
12345  3  4  1


I want the output like this:

Code:

12345  6  9  8


Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
subhasis_50
Beginner


Joined: 17 Jun 2005
Posts: 4
Topics: 3
Location: KOLKATA,India

PostPosted: Fri Jun 17, 2005 4:59 am    Post subject: Reply with quote

Hi,
Use the following
Code:

//STEP01    EXEC PGM=SORT                                         
//SYSOUT    DD SYSOUT=*                                           
//SORTIN    DD DISP=SHR,DSN=INPUT-FILE NAME                     
//SORTOUT   DD DSN=OUTPUT FILE NAME,                                 
//             DCB=*.SORTIN,                                     
//             DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(1500,500),RLSE)
//SYSIN  DD  *                                                   
  SORT FIELDS=(1,5,CH,A)                                         
  SUM FIELDS=(7,1,ZD,9,1,ZD,11,1,ZD)                             
/*

_________________
Thanks & Regards
Subhasis
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Fri Jun 17, 2005 5:04 am    Post subject: Reply with quote

Paneendra,

Here is the jcl
Code:

//STEP0001 EXEC PGM=ICETOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//TOOLIN   DD *
  SORT FROM(IN) TO(OUTX) USING(ICE0)
/*
//IN       DD *
12345 1 2 3
12345 2 3 4
12345 3 4 1
/*
//OUTX     DD SYSOUT=*
//ICE0CNTL DD *
  OPTION ZDPRINT
  SORT   FIELDS=(1,5,ZD,A)
  SUM    FIELDS=(7,1,ZD,9,1,ZD,11,1,ZD)
/*

You don't need to post the same thread in several forums. You will find the same persons to answer you in each of them.

Such needs have been answered many times. It could be good to make a search before.

Alain
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: Fri Jun 17, 2005 5:15 am    Post subject: Reply with quote

subhasis_50/Alain Benveniste,

I am guessing that there is much more to this requirement. It is just not a simple summing of 3 fields.

I guess it is more in the lines of this topic ( summing values horizontally and then writting them across 1 line)

http://www.mvsforums.com/helpboards/viewtopic.php?t=3289


Vkphani,

Please search before posting. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=3289

Hope this helps...

Cheers

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


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Aug 08, 2005 10:44 pm    Post subject: Reply with quote

Hi All,

Thanks for the help.
Back to top
View user's profile Send private message Send e-mail
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