Hi ,
Can any one help me how we can display the total count if records that are present in the header not at the trailer. I used the below logic. It worked for Trailer. But i replaced trailer with Header the job is failing.
//COUNT EXEC PGM=SORT,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Input file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=10))
/*
How to get the count of total records
Moderators: Frank Yaeger, Moderator Group
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Well, I don't like the "design". You could drive a very wid truck through the gaps without scraping the sides.
You should be able to find examples of this.
Use JOINKEYS, with the same dataset on both legs of the JOINKEYS.
In JNF2CNTL set a value of one on each record (cut it down so it is almost just that) and use SUM. The only other value you need on the record is something "low" so that the single record which comes out of the JNF2CNTL appears first.
Use JOIN F1,F2,ONLY
Your F2 is the header. Do your remaining formatting.
You should be able to find examples of this.
Use JOINKEYS, with the same dataset on both legs of the JOINKEYS.
In JNF2CNTL set a value of one on each record (cut it down so it is almost just that) and use SUM. The only other value you need on the record is something "low" so that the single record which comes out of the JNF2CNTL appears first.
Use JOIN F1,F2,ONLY
Your F2 is the header. Do your remaining formatting.
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