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
 
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

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