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
 

 

Utility for counting records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
bravas

New User


Joined: 31 Oct 2008
Posts: 6
Location: madrid

PostPosted: Tue Aug 11, 2009 4:51 pm    Post subject: Utility for counting records
Reply with quote

Utility for counting records:


Hello everyone, I am looking for an utility for counting records
through a JCL.


There is a program used to count the records in a file?


Thanks in advance
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 11, 2009 4:58 pm    Post subject:
Reply with quote

DFSORT / SYNCSORT / CA-SORT would probably be the most efficient.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 11, 2009 5:00 pm    Post subject:
Reply with quote

You can use SORT utility for the same...
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 11, 2009 5:19 pm    Post subject:
Reply with quote

It would be like this..
Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
  SORT FIELDS=COPY
  OUTFIL REMOVECC,NODETAIL,
   TRAILER1=('No of records: ',COUNT=(M11,LENGTH=8))
/*
Back to top
View user's profile Send private message
bravas

New User


Joined: 31 Oct 2008
Posts: 6
Location: madrid

PostPosted: Tue Aug 11, 2009 5:25 pm    Post subject:
Reply with quote

Thanks a lot ,It is very useful for me this information.


I will try to see if it works, thanks again
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Aug 11, 2009 6:54 pm    Post subject:
Reply with quote

short of putting a counter in the process that generates the file.....
thus saving the need for yet another program execution just to generate a record count

using sort is a good idea.
I would output to a dummy,
and not use the trailer record,
but rely on the counts provided in the statistics of the sort utility.

bad enough somebody thinks he needs to know the record count,
at least derive the count without generating a new files.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 11, 2009 7:00 pm    Post subject:
Reply with quote

Yes, Dick has reiterated a point that I made some weeks ago regarding record counts for files. These should be displayed in the syslog and joblog of the creation job at the very least.

Obviously with external files it may be different if the sender does not notify the receiver of the record count. But then again if you do not know the number of records that you should have received, why bother to count them icon_rolleyes.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 11, 2009 7:41 pm    Post subject:
Reply with quote

DFSORT'S ICEGENER can be used for it..
Code:

//S1    EXEC  PGM=ICEGENER
//SYSPRINT DD SYSOUT=*     
//SYSUT1 DD your input dsn here             
//SYSUT2 DD DUMMY         
//SYSIN    DD DUMMY       


In SYSPRINT you can find
Code:

ICE054I 0 RECORDS - IN: count, OUT: count 
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 11, 2009 9:04 pm    Post subject:
Reply with quote

Unless this is again something to do with crazy tools I'll vote in for Expat and Dick. I, for one, would be intrested to know such a business requirement.
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: Tue Aug 11, 2009 9:54 pm    Post subject:
Reply with quote

The COUNT operator of DFSORT's ICETOOL can be used to display a message with the count and/or create a file with the count.

To display the count in a message:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//TOOLIN DD *
COUNT FROM(IN)
/*


TOOLMSG will have the count in a message. For example:

ICE628I 0 RECORD COUNT: 000000000000007

To write a record with the count (and also display it in a message):

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//CT DD SYSOUT=*
//TOOLIN DD *
COUNT FROM(IN) WRITE(CT)
/*


CT will have the count. For example:

Code:

000000000000007


The count in the output file can be formatted in various ways.
Back to top
View user's profile Send private message
Balakrishnan

New User


Joined: 21 Aug 2009
Posts: 3
Location: US

PostPosted: Fri Aug 21, 2009 12:58 am    Post subject: Reply to: Utility for counting records
Reply with quote

You can also use File-Aid Batch. Just an additional info:

//COUNTSTP EXEC PGM=FILEAID
//DD01 DD DISP=SHR,DSN=USER007.PROCESS.ADDS
//DD02 DD DISP=SHR,DSN=USER007.PROCESS.CHNGS
//DD03 DD DISP=SHR,DSN=USER007.PROCESS.DELS
//SYSIN DD *
$$DD01 TALLY
$$DD02 TALLY
$$DD03 TALLY
//SYSPRINT DD SYSOUT=I
//SYSOUT DD SYSOUT=*
/*
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 -> JCL & VSAM 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 Use DebugTool CodeCoverage Uti... neo4u IBM Tools 0 Thu Jun 22, 2017 6:38 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 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 HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm


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