Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding tables in a DB2 package

Status
Not open for further replies.

CT004691

Programmer
Jan 10, 2003
17
GB
Apart from using EXPLAIN can anyone tell me how to find the names of tables used within a mainframe DB2 package?
 
CT004691,

If you can't rebind in order to turn explain on (I'm guessing you're in production here), then you could try dropping into QMF and interrogating the SYSPACKSTMT table. The column STMT contains the SQL I think, but it's unformatted and looks awful. You'll have to trawl through it looking for the table names.

Marc
 
S0d that for a game of soldiers. I looked at that option and didnt fancy it, hence the question.
 
Fair enough.

Knock up JCL to rebind the package in test/dev and add EXPLAIN(YES) to the bind statements. Whatever SQLID the bind is run under, you will need to set up an sqlid.PLAN_TABLE and this should then write explain statements to that table.

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top