I am new to mainframes.I just read about this DFSORT command in one of the posts which is for counting the number of records in the dataset.Could Someone explain how exactly the last 2 lines work and what are the functions nodetail,removecc.
Please use a meaningful Subject for future posts. "Hi" does not tell us anything about your question.
I'm you're not familiar with DFSORT or DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT Getting Started". It's an excellent tutorial, with lots of examples, that shows you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books and papers, from:
An OUTFIL statement is used to write records to an OUTFIL DD. In this case, since neither the FNAMES nor FILES parameters are specified to give the ddname, the default ddname of SORTOUT is used.
TRAILER1 writes a report trailer at the end of the report. In this case, it writes one record to SORTOUT with a 10-byte count of the number of records in the input data set. LENGTH=10 says the length of the output field is 10 bytes. M10 is an edit mask that tells DFSORT to use leading blanks for zeros in the count. So if the count is 27, it will be displayed as 'bbbbbbbb27' where each b is a blank. M11 would tell DFSORT to use leading zeros, e.g. 27 would be displayed as '0000000027'. DFSORT has 27 edit masks as well as an EDIT parameter that lets you design your own masks.
By default, DFSORT would write the data lines to the output data set. NODETAIL tells DFSORT not to write the data lines. So we only get the TRAILER1 line. Without NODETAIL, SORTOUT would have:
data record 1
data record 2
We don't want the data records, so we use NODETAIL to suppress them.
By default, when DFSORT writes a report (triggered by the use of the OUTFIL parameters LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS or NODETAIL) it uses ANSI carriage control characters in the first byte of the output record to tell the printer what to do (e.g. '1' means page eject). REMOVECC tells DFSORT to remove the ANSI carriage control characters. Without REMOVECC, the record in SORTOUT would look like this for an input file with 27 records (b for blank):
We don't want the 1, so we use REMOVECC to remove it to get:
If you want to learn more about DFSORT, use the link I gave you above.