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 

Doubt in SUM FIELDS

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


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Wed Feb 27, 2008 7:16 am    Post subject: Doubt in SUM FIELDS Reply with quote

Is it possible in a sort card with SUM FIELDS=(something), the number of summed fields

for Examples
This is the input file
Code:
A10
B11
C01
A03
B05


I'm using this control card

Code:
SORT FIELDS=(1,1,CH,A)
  SUM FIELDS=(2,2,ZD)


So I would get the output as
Code:
A13
B16
C01


But how do I find the number of items summed up? for eg. for A 2 items were summed up. For B 2 items were summed up and for C 1 item was summed up. How do I find this?
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 27, 2008 10:41 am    Post subject: Reply with quote

edkir98,

You can use one of the following DFSORT JCL to get the desired results.

Code:

//STEP0100 EXEC PGM=ICEMAN                 
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                           
A10                                       
B11                                       
C01                                       
A03                                       
B05                                       
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  SORT FIELDS=(1,1,CH,A)                   
  OUTFIL REMOVECC,NODETAIL,               
  SECTIONS=(1,1,                           
  TRAILER3=(1,1,X,                         
            TOT=(2,2,ZD,M11,LENGTH=4),X,   
            COUNT=(M11,LENGTH=2)))         
/*                                         


or

Code:

//STEP0100 EXEC PGM=ICEMAN   
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD *             
A10                         
B11                         
C01                         
A03                         
B05                         
//SORTOUT  DD SYSOUT=*       
//SYSIN    DD *             
  SORT FIELDS=(1,1,CH,A)     
  INREC OVERLAY=(7:C'01')   
  SUM FIELDS=(2,2,ZD,7,2,ZD)


Hope this helps...
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Wed Feb 27, 2008 11:08 am    Post subject: Reply with quote

Thanks Kolusu,
Padding an extra 1 and then summing with that was the logic I had worked out previously but wanted to know if there was a direct method to find out the number of summed fields.

Thanks for the help.
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 27, 2008 12:13 pm    Post subject: Reply with quote

edkir98 wrote:
Thanks Kolusu,
Padding an extra 1 and then summing with that was the logic I had worked out previously but wanted to know if there was a direct method to find out the number of summed fields.

Thanks for the help.


edkir98,

What exactly do you mean direct ? The first solution with sections and trailer is indeed a direct method.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Thu Feb 28, 2008 4:43 am    Post subject: Reply with quote

Ohh my.. I missed it by oversight. Thanks for the help. That was what I exactly needed.
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
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