IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to sum using SORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
svsarath

New User


Joined: 30 May 2006
Posts: 16

PostPosted: Sat Dec 26, 2009 2:06 am
Reply with quote

Hi,

Please help me on the following using SORT

Code:
Input:

Column#1 Column# 2
1               -50
2                10
1                10
2                20


Code:
Output:
1              -40
2               30
T

Thanks for your help.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Dec 26, 2009 3:07 am
Reply with quote

Any chance that you could mention what sort product you are using, the record format and length, the field lengths, positions, and formats, just so we don't have to guess at everything. Any chance that you could search on previous posts?
Back to top
View user's profile Send private message
JnanaR

New User


Joined: 20 Jul 2009
Posts: 23
Location: Mumbai

PostPosted: Mon Dec 28, 2009 12:06 am
Reply with quote

sort fields=(position of column1,1,CH,A)
sum fields=(position of colum2,2,ZD)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Dec 28, 2009 4:36 am
Reply with quote

Hello,

The posted code was not tested. . . It will not work as posted. . .

Quote:
Any chance that you could mention what sort product you are using, the record format and length, the field lengths, positions, and formats, just so we don't have to guess at everything. Any chance that you could search on previous posts?
Little to no chance. . .

I guess i'd forgotten that Christmas was supposed to be a Psychic Day. . .
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Dec 28, 2009 6:57 pm
Reply with quote

With the information in hand, you may try something similar to what is suggested here.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top