Count the number of records and create a report.

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.

Topic author
Disha Shetty
Registered Member
Posts: 18
Joined: Sat Aug 17, 2013 4:54 pm
Has thanked: 2 times

Count the number of records and create a report.

Postby Disha Shetty » Sat Jul 16, 2016 2:24 pm

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?



Tags:


nicc
Global Moderator
Global Moderator
Posts: 510
Joined: Wed Apr 23, 2014 8:45 pm
Been thanked: 10 times

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

Postby nicc » Sat Jul 16, 2016 5:26 pm

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


Topic author
Disha Shetty
Registered Member
Posts: 18
Joined: Sat Aug 17, 2013 4:54 pm
Has thanked: 2 times

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

Postby Disha Shetty » Tue Jul 19, 2016 2:21 pm

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: 510
Joined: Wed Apr 23, 2014 8:45 pm
Been thanked: 10 times

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

Postby nicc » Tue Jul 19, 2016 4:24 pm

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


Topic author
Disha Shetty
Registered Member
Posts: 18
Joined: Sat Aug 17, 2013 4:54 pm
Has thanked: 2 times

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

Postby Disha Shetty » Wed Jul 20, 2016 2:32 pm

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.




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

Who is online

Users browsing this forum: CommonCrawl [Bot] and 2 guests