× 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.



There are basically three types of programs on IBM i:
- OPM or Original Program Model programs
- ILE or Integrated Language Programs
- Service programs
ILE programs are composed of Module objects.
The reason this is important is that QSYS2.PROGRAM_INFO will return the
name of the source file used on OPM programs. While you will also have to
pump your ILE programs through QSYS2.BOUND_MODULE_INFO
See also QSYS2.BOUND_SRVPGM_INFO
You can see this stuff in DSPPGM
On an OPM program you'll see:
Type of program . . . . . . . . . . . . . . . . : OPM
Source file . . . . . . . . . . . . . . . . . . : QCLSRC
Library . . . . . . . . . . . . . . . . . . . : ROUTINES
On an ILE program you'll have to drill into DSPPGM PGM(ROUTINES/ACD0010)
DETAIL(*MODULE)
On a service program you'll have to drill into DSPSRVPGM
SRVPGM(ROUTINES/SRVPGM) DETAIL(*MODULE)

If you want to count lines then it's a simple matter of
select system_table_schema, system_table_name, system_table_member,
number_rows
from qsys2.syspartitionstat;
for each source file.

It's different if you are storing source in stream files.

Bibliography:
IBM i Services (SQL) <https://www.ibm.com/support/pages/node/1119123>
Db2 for i catalog views - IBM Documentation
<https://www.ibm.com/docs/en/i/7.5?topic=reference-db2-i-catalog-views>
IBM i Services - IBM Documentation
<https://www.ibm.com/docs/en/i/7.5?topic=optimization-i-services>




On Tue, Jun 27, 2023 at 12:16 PM tim ken <timk2574@xxxxxxxxx> wrote:

Hi,

Is there any SQL query which could provide lines of code used inside all
the programs and all the associated modules used in the entire IBM i
system?


Also in this SQL query can we know how many lines are commented and how
many lines are actual program and module code separately in different
columns against each program and it's associated module name ?


Thanks a lot...
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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.