Open worksofliam opened 4 years ago
Hi @worksofliam - you can also try using these SQL functions as they might be easier than working with the APIs and then dumping to temp files/outfile.
I'm not 100% sure it gets you all the same information as the APIs, but worth looking into.
Hey @jkdavew
I updated the post with an SQL script I started to write. Thanks for the suggestion!
This is the first of two entries. This will be about how to get the information. The second about actually building the dep list. I will keep expanding this post as I find more information.
Starting list
DSPPGMREF PGM(GITCM/*ALL) OUTPUT(*OUTFILE) OBJTYPE(*PGM *SRVPGM) OUTFILE(QTEMP/INFO)
SELECT WHLIB, WHPNAM, WHFNAM, WHLNAM, WHOBJT, WHSPKG FROM qtemp/info WHERE WHFNAM not like 'Q%'
(maybe a group by should be used here)Should give you a base list to work from:
DSPOBJD
with an outfile?You should end up with a list of:
Program / Service program info
We need to find:
DSPPGM
andDSPSRVPGM
don't have simple outfiles and nobody in 2020 should be parsing spool files. There are two APIs to get the info we want:They both write information to a user space, which could then be written to an outfile. A bit of extra work but worth it in the long run to get this working.
So now, in total, we should have:
Still to determine
Update: using SQL
The OS now ships information about program/service program references. Here's a little SQL I wrote to use this to generate the start of a makefile.