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
 

 

How to find the total number of records in a file

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

New User


Joined: 01 Mar 2005
Posts: 15
Location: chennai

PostPosted: Mon Mar 21, 2005 11:45 am    Post subject: How to find the total number of records in a file
Reply with quote

how can i get hte total number of records present in a file?..
is there any solutions? please answers to this question?
Back to top
View user's profile Send private message

sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 190
Location: hyderabad

PostPosted: Mon Mar 21, 2005 2:30 pm    Post subject:
Reply with quote

HI balu

the is a count function in DFSort

COUNT is an automatic DFSORT maintained counter of all records for this statement.


SORT FIELDS=(1,15,CH,A)
OUTFIL TRAILER1=(20:'NUMBER OF RECORDS ON FILE? ,COUNT),NODETAIL


In this example a count of the number of records on the input file is printed at the end of sorting. The NODETAIL specifies that no detail lines are to be printed. If this was not specified every record would be printed unformatted.

for more information..click on..
http://www.damos.dircon.co.uk/html/dfsort_reports.html


COUNT - prints a message containing the count of records in a data set. Can also be used to set RC=12 or RC=0 based on the count of records in a data set (that is, empty, not empty, higher, lower, equal or not equal).

for more information..click on..
http://www-1.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/srtmatol.html
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Wed Mar 23, 2005 9:59 pm    Post subject:
Reply with quote

Hi
As mentioned by Siva you can use SYNCSORT/DFSORT to get the count.
Also you can FILEAID too.

SORT solution.
----------------
If you have DFSORT change SYNCTOOL to ICETOOL. Check the TOOLMSG
to find the count.

Code:

//COUNT    EXEC PGM=SYNCTOOL         
//TOOLMSG   DD SYSOUT=*             
//DFSMSG    DD SYSOUT=*             
//INPFILE   DD DSN=YOUR INPUT FILE,
//             DISP=SHR             
//TOOLIN    DD *                     
  COUNT FROM(INPFILE)                     
/*                                   


Fileaid Solution.
-----------------
Check the SYSPRINT.
Code:

//STEP1    EXEC PGM=FILEAID         
//*                                 
//DD01     DD DSN=YOUR INPUT FILE, 
//            DISP=SHR               
//SYSPRINT DD SYSOUT=*               
//SYSLST   DD SYSOUT=*               
//SYSIN    DD *                     
$$DD01 TALLY                         
/*                                   
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 Mar 23, 2005 11:43 pm    Post subject:
Reply with quote

Here's a DFSORT job to get one output record with the count.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT  DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(COUNT=(M11,LENGTH=8))
/*


Note that COUNT=(M11,LENGTH=8) gives us an 8-byte count with leading zeros. COUNT=(TO=ZD,LENGTH=8) would do that as well. We could use other edit masks or conversion formats to display the count in other ways, e.g. COUNT=(EDIT=(III,IIT)) or COUNT=(TO=FS,LENGTH=8).

We also use NODETAIL to suppress the detail records, and REMOVECC to suppress the ANSI carriage control character.

Alternatively, you can use the COUNT operator of DFSORT's ICETOOL to display the COUNT in a message in the TOOLMSG data set.
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 Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am


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