× 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 wrote my first UDTF following a presentation by Scott Klement. Basically you pass in 3 parameters:
Library_name: library name or *ALL *CURLIB *LIBL *USRLIBL
Object_type: *PGM, *SRVPGM or *ALL to get both
Object_name: program or service program name or null to get all

It then queries qsys2.object_statistics to get a list of the above.

Then it forks off and uses either the retrieve program information or the retrieve service program information api.

Sample use:
select t.*
from table(Retrieve_Program_information('ROB', '*SRVPGM', 'HELLOWORLD')) as t
;

select t.*
from table(Retrieve_Program_information('ROB', '*PGM', 'AAASQL')) as t
;
select t.*
from table(Retrieve_Program_information('ROB', '*PGM', 'AADELETEME')) as t
;
select t.*
from table(Retrieve_Program_information('ROB', '*PGM', 'CHKDOMJOBS')) as t
;
select t.*
from table(Retrieve_Program_information('ROB', '*ALL', 'HELLOWORLD')) as t
;
select t.*
from table(Retrieve_Program_information('ROB', '*ALL')) as t
;

Completely **free format RPG

Sample output:
https://imgur.com/Y5eb60F

Raw, rude and crude but gets what I needed done.

Since figuring out how to debug such a beast using RDi was rough I have a bunch of lines like this I need to strip out:
command = 'SNDMSG MSG(''sql_state on Open ' +
sql_state + ' ' + library_name + ' ' + object_type_list + ' ' + object_name +
''') TOUSR(ROB)';
CommandLength = %len(%trim(command));
callp qcmdexc(command: CommandLength);

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.