Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
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
vijayamadhuri

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

Hi,
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.

//COUNT EXEC PGM=SORT
//SORTIN DD DSN=MY.DATASET,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=MY.OUTPUT.DSN,DISP=(,CATLG,DELETE),...
//SYSIN DD DATA
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M10,LENGTH=10))
/*
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

VM,

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

Code:

  OUTFIL REMOVECC,NODETAIL,
     TRAILER1=(COUNT=(M10,LENGTH=10))


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):

1bbbbbbbb27

We don't want the 1, so we use REMOVECC to remove it to get:

bbbbbbbb27

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 column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am

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