Page 1 of 1

To get table name and query mode of access in a cobol prog.

PostPosted: Sun Mar 17, 2013 7:39 pm
by Kiru_J
Is there anyway to get tables accessed and their corresponding query mode of access in a cobol program? Either through REXX or any DB2 catalog tables have this information? Need help...

Re: To get table name and query mode of access in a cobol pr

PostPosted: Sun Mar 17, 2013 8:47 pm
by Akatsukami
It's unclear what you're asking. Could this task be accomplished by reading the source and looking at the SQL? If so, and if you have a small number of source modules to go through, you will probably be best doing it by hand; a Rexx script that read the DBRMLIB and the SYSPACKAGES table could undoubtedly be written, but it would take more effort than going through the source.

Re: To get table name and query mode of access in a cobol pr

PostPosted: Sat Mar 23, 2013 10:59 am
by Kiru_J
Yes i do agree,it would take much effort. But i just need something which would give me a the list of tables accessed in all the cobol programs in endevor along with the mode of access to tables.

Re: To get table name and query mode of access in a cobol pr

PostPosted: Fri Mar 29, 2013 12:03 am
by pmartyn
Kiru
You can always let DB2 do the work for you. Bind the package with EXPLAIN(YES) and it will take all the information and place it in the plan table for you to view. Everything it touches and the details regarding access, etc
More Info;
Specify the EXPLAIN(YES) option when you bind the plan or package. With EXPLAIN(YES), only a small amount of additional processing is required to insert the results in a plan table. The same processing for access path selection is performed, regardless of whether you use EXPLAIN(YES) or EXPLAIN (NO).

Here is the link for your reference
http://pic.dhe.ibm.com/infocenter/dzich ... ininfo.htm

PM