You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# SQL Procedure to find Program Usage recursively using DSPPGMREF
2
+
3
+
Given a program (or any of the objects that DSPPGMREF handles), the PGM_REFS procedure will find all the obects that the program uses, and then recursively find all that objects that they use, and so on, to an essentally unlimited depth.
4
+
5
+
This is the product of my experimentation with PL/SQL. It may be short on error handling, and it doesn't do any validity checking on the paremeters.
6
+
7
+
If you have more experience than me, please feel free to suggest better coding techniques.
8
+
9
+
So far I have not found a decent manual or turorial. If you have any I'd like to know.
10
+
11
+
My primary source was trial and error, with help
12
+
from these articles by Ted Holt in IT Jungle:
13
+
[Ted HolT Article 1](https://www.itjungle.com/2017/06/12/guru-error-handling-sql-pl-part-1/) and
and browsing [Scott Forstie Gists on Github](https://gist.github.com/forstie
16
+
)
17
+
18
+
In no way does this replace a real cross reference utilily, such as Hawkeye
19
+
or X-Analysis. If you don't have one, this might be somewhat useful.
20
+
21
+
## pgm_refs_Tbl.sql
22
+
23
+
This is the DDL to create the file that the procedure builds.
24
+
25
+
Change the library and then run this first.
26
+
27
+
## pgm_refs.sql
28
+
This is the code to create the PGM_REFS procedure. The library in which the REFS file is build needs to be changed to suit your environment.
29
+
30
+
## pgm_refs_test.SQL
31
+
32
+
These are some samples of calling the procedure to test it. I used iACS Run SQL scripts. You could also call it in a CL program using the RUNSQLSTM command.
0 commit comments