DSPPGMREF will get the F specs but…
Not SQL uses and I’m not sure about External Data structures.
For those you will have to Scan the Source code.
Use the DSPPGMREF command specifying *ALL programs in a library to an outfile. Then run a query on the outfile with the following selection criteria and press Enter.
WHFNAM EQ ‘Filename’
The output dislplays all the programs that are using the particular file.