Hi,
I'm creating an ad-hoc report, for that purpose I have to count the no. of records and put the count in the output flat file. I need the data in the output file as "Count of records:" as one field and the "count" as second field. Please help me out.
Count number of records in a file - JCL SORT.
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Count number of records in a file - JCL SORT.
Hi,
Assuming a count of 99,999,999 will suffice, please try this:
Assuming a count of 99,999,999 will suffice, please try this:
Code: Select all
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('Count of records: ',COUNT=(M11,LENGTH=8))
/*
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute