Hi All,
We have a requirement where we need to add the amounts according to the Country and accounting months.
E.g.
Input
C1 01 10.00
C1 01 10.00
C1 02 50.00
C1 02 50.00
C1 03 70.00
C1 03 70.00
C2 01 20.00
C2 01 20.00
C2 02 30.00
C2 02 30.00
Output:
C1 01 20.00 <-- Additing of amount for accounting month 01
C1 02 120.00 <--- Addition of amount for Accounting Month 01 and 02
C1 03 260.00 <--- Addition of amount for Accounting Month 01,02,03
C2 01 40.00
C2 02 100.00
We can easily sum up the amount as per Accounting month but the problem is to sum up amount for the current month with the all old accounting months.
Not sure if it is possible through JCL. Any help is very much appriciated.
Thanks in advance
Addition of Amounts using Sort JCL
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Yes William, I need the Cumulative figure by month,
But it should be like for 02 month the sum will Cumulative sum of 01 + Cumulative sum of 02.
For Month 03 the sum will Cumulative sum of 01 + Cumulative sum of 02 + Cumulative sum of 03. Like wise
I checked the figures in the example are correct as per the above criteria.
Not sure, if i am clear this time.
But it should be like for 02 month the sum will Cumulative sum of 01 + Cumulative sum of 02.
For Month 03 the sum will Cumulative sum of 01 + Cumulative sum of 02 + Cumulative sum of 03. Like wise
I checked the figures in the example are correct as per the above criteria.
Not sure, if i am clear this time.
Please not that "sort JCL" cannot do this. It can only tell the os that you want to run sort and it needs the resources specified in the JCL. Also note that there is a sort section of the forum (titled DFsor but is for all sort products).
You need to specify which sort product you are using as the sort control cards required may differ depending on the sort product.
You need to specify which sort product you are using as the sort control cards required may differ depending on the sort product.
Regards
Nic
Nic
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page