How can you sort using TALLY?
Moderators: DikDude, Moderator Group
How can you sort using TALLY?
I want to read a file containing item codes and create a report containing a row for each unique item code along with the number of times it appears in the file, displayed in descending count sequence. Can I do this using TALLY? If so, how? If not, any ideas? Thanks.
With only 3k items, you could create an array within the code that contains all of the item codes (to be populated by code, not keying<g>) and a count field (initialized to zero and incremented by 1 each tme this item code is detected in the input data).
Once the input data has all been read, sort the array by count descending and generate the report you want.
Once the input data has all been read, sort the array by count descending and generate the report you want.
Have a good one
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