Skip to content

Instantly share code, notes, and snippets.

Created September 28, 2019 14:47
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
The Display Software Resources (DSPSFWRSC) command allows you to show, print, or write to an output file the list of installed software resources. This SQL example shows how to externalize the same detail by extracting message text and transforming numerics into integer form.
-- category: Software Resources
-- description: DSPSFWRSC for SQL users
create or replace function coolstuff.whatsinstalled ()
returns table (
product varchar(7) ccsid 37, load integer, option integer,
software_text varchar(132) ccsid 37
external action
modifies sql data
call qsys2.qcmdexc(
return select lcprdi, lcpfgi, lcsfgi, message_text
from qtemp.prod_info
inner join qsys2.message_file_data
on message_file_library = lcdtml
and message_file = lcdtmf
and message_id = lcdtmi;
-- Display Software Resources...
select * from table(coolstuff.whatsInstalled());
-- Is DB2 SMP installed?
select count(*) SMP_INSTALLED from table(coolstuff.whatsInstalled())
where product = '5770SS1' and option = 26;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment