Hi,
I have the input with ZD values and i want the sum all the input records and diaplay the sum at bottom through JCL.
I am getting the totals for the duplicate records only but i need to get total irrespective of the data.
Anyone please help me.
Thanks,
Mit's
How get totals at bottom of the files
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 8
- Joined: Mon Feb 27, 2006 4:31 pm
- Location: India
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You didn't give any details, so I can only give you a general answer.
You can use a DFSORT control statement like this to get the total of your ZD fields. For the example, I assumed your ZD field is in positions 11-15.
The trailer record might look like this:
If you need more specific help, you need to give me more details such as showing the job you're using, the position and length of the ZD field, and what you want the trailer record to look like.
You can use a DFSORT control statement like this to get the total of your ZD fields. For the example, I assumed your ZD field is in positions 11-15.
Code: Select all
OUTFIL REMOVECC,
TRAILER1=('TOTAL:',11:TOT=(11,5,ZD,TO=ZD,LENGTH=5))
Code: Select all
TOTAL: 13602
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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