Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us