To get started… no api’s: use the DSPSFWRSC command and direct output to an outfile, which you may access through normal RPG or CL-coding. The content of this file answers your needs. Sample command:
DSPSFWRSC OUTPUT(*OUTFILE) +
In general, to find if a product is installed, call the Retrieve Product Information (QSZRTVPR) API passing in the info for the product you want.
Here’s a very basic example that retrieves info for Java 1.4, which is 5722-JV1 option 6 on V5R4:
dcl &rcvvar *char 108 value( ' ' )
dcl &PRDI0100 *char 27 value( '5722JV1*CUR 0006*CODE' )
call QSZRTVPR ( +
You might retrieve the i5/OS info first, to decide if 5722-JV1 is the correct product ID to look for. And you might choose to list load/option pairs to decide which ones are available.