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 

Cumulative addition using DFSORT

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


Joined: 14 Mar 2005
Posts: 38
Topics: 15
Location: Bangalore

PostPosted: Tue Mar 14, 2006 2:53 am    Post subject: Cumulative addition using DFSORT Reply with quote

Hi All,

It is possibe to do cumulative addition in DFSORT? I need to create the output file with Field3, it contains cumulative addition of input file Field2.

Input File
Field1 Field2
xxxxx 23
yyyyy 10
uuuuu 20

Example
First record contain - 23
Second record contain - addition of record1 and record 2 ie 33
Third record contain - addition of record2 and record3 ie 53

Desired output
Field1 Field2 Field3
xxxxx 23 - 23
yyyyy 10 - 33
uuuuu 20 - 53


Thanks in advance
Hari
Back to top
View user's profile Send private message Send e-mail MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Mar 14, 2006 10:58 am    Post subject: Reply with quote

gharidoss,

Try this job.

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
XXXXX 23                                           
YYYYY 10                                           
UUUUU 20                                           
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                   
 SORT FIELDS=COPY                                 
 OUTREC FIELDS=(1,80,SEQNUM,8,ZD)                 
 OUTFIL REMOVECC,NODETAIL,                         
 SECTIONS=(81,8,                                   
 TRAILER3=(1,6,SUBTOTAL=(7,2,ZD,EDIT=(IIIIIIIT))))
/*                                                 


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
gharidoss
Beginner


Joined: 14 Mar 2005
Posts: 38
Topics: 15
Location: Bangalore

PostPosted: Sun Mar 19, 2006 11:30 pm    Post subject: Reply with quote

Hi Kolusu,

Sorry for the late reply.

It's working fine and thanks a lot...


Thanks,
Hari
Back to top
View user's profile Send private message Send e-mail MSN 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