MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
gharidoss Beginner Joined: 14 Mar 2005 Posts: 38 Topics: 15 Location: Bangalore
Posted: Tue Mar 14, 2006 2:53 am Post subject: Cumulative addition using DFSORT
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Tue Mar 14, 2006 10:58 am Post subject:
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
gharidoss Beginner Joined: 14 Mar 2005 Posts: 38 Topics: 15 Location: Bangalore
Posted: Sun Mar 19, 2006 11:30 pm Post subject:
Hi Kolusu,
Sorry for the late reply.
It's working fine and thanks a lot...
Thanks,
Hari
Back to top
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