× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I don't have the precise commands at my fingertips, but here is a way to tackle it.

With SQL, I normally access fields by their NAMES, because when I am looking at source code, I like to see immediately what the code is doing. But with SQL we can also address fields by their #s ... in your case 1-10, or by a variable passed to the SQL code within RPG loop.

With SQL, we can do COUNT(*) number of records with some characteristics.
So one count gives you count of records in the file.
Another count gives you count of records where some field content is blank or zeros.
Subtract second count from first to give you count of that field populated with something, that may be valid, or may be garbage, but is not blank or zero.

You would need to use DSPFFD in association with each chunk of code per file to see how many fields for your N loop. There may be some SQL error message code if you try to access more fields than are there.

Depending on file structure (multiple members), SQL might not be your optimal tool.

I am trying to get the "usage" count on all fields in any file on the system.
Have looked in QSYS at some of the system files -- but not seeing anything
I can use.

Here is what I need: Say a file has 10 fields per record....and contains a
1000 records. I need the count of each of the 10 fields that have
"infomation" in them. Not looking for the record count.

Can write a program or use query tools to get this -- simply looking for an
easier way.

Thanks!

--Rick



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.