Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
DFSORT to count number of records

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message

Active User

Joined: 06 Apr 2005
Posts: 180

PostPosted: Wed Apr 27, 2005 8:02 pm    Post subject: DFSORT to count number of records
Reply with quote

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.

Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Apr 27, 2005 8:30 pm    Post subject:
Reply with quote


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
count record

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us