Count the number of records and create a report.

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
Disha Shetty
Registered Member
Posts: 20
Joined: Sat Aug 17, 2013 4:54 pm

Count the number of records and create a report.

Post by Disha Shetty »

Is there any way by which I can get a kind of report having the file name and the count of records in that? Like this

Code: Select all

   File Name          Record Count
file.name.one          12056
file.name.two          6342
file.name.three        53153
file.name.four         79495
file.anme.five          9395
Anyne can please provide any pointer on this?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Count the number of records and create a report.

Post by nicc »

Probably plenty of ways but without knowing what your input data is how can we tell? Please describe it fully i.e. LRECL RECFM number of records (approximately) whether duplicates are possible or not.

BTW: on z/OS they are not file names but data set names. Files exist on PCs and Unix.
Regards
Nic
Disha Shetty
Registered Member
Posts: 20
Joined: Sat Aug 17, 2013 4:54 pm

Re: Count the number of records and create a report.

Post by Disha Shetty »

Ok, I shall call file as data-set.

All the files are Fixed-block and lrecl is 80. They are listed inside other dataset, which is also FB and LRECL=80. Duplicates are not there.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Count the number of records and create a report.

Post by nicc »

You have a data set the contents of which is a list of data set names and you want to produce a report that consists of each of those data set names and there respective record counts?

You can write a program that will read the data set and generate a sort for each data set name to be reported on with a final step that will be another program that will read the sysout from each sort step and extract the record count. You may be able to utilise the COUNT oprator of sort so that your last program ony has to read one line but I am not a "power" sort user so I cannot confirm that off the top of my head.

There are other ways of doing this involving dynamic allocation in COBOL or PL/1 or a Rexx program to call sort against each data set name in your list or, if the volume count of each data set is small, a simple EXECIO * into a stem and look at stemname.0 is simple.
Regards
Nic
Disha Shetty
Registered Member
Posts: 20
Joined: Sat Aug 17, 2013 4:54 pm

Re: Count the number of records and create a report.

Post by Disha Shetty »

nicc wrote:You have a data set the contents of which is a list of data set names and you want to produce a report that consists of each of those data set names and there respective record counts?
yes this is correct, this is what I want to do.
You can write a program that will read the data set and generate a sort for each data set name to be reported on with a final step that will be another program that will read the sysout from each sort step and extract the record count. You may be able to utilise the COUNT oprator of sort so that your last program ony has to read one line but I am not a "power" sort user so I cannot confirm that off the top of my head.

There are other ways of doing this involving dynamic allocation in COBOL or PL/1 or a Rexx program to call sort against each data set name in your list or, if the volume count of each data set is small, a simple EXECIO * into a stem and look at stemname.0 is simple.
Thanks. I am alos not very good with SORT but I think this is how i want to do it. I shall try to get a soluton for it.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”