MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Find tables used by a program- packages

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sumithar
Beginner


Joined: 22 Sep 2006
Posts: 84
Topics: 29

PostPosted: Wed Nov 16, 2011 3:09 pm    Post subject: Find tables used by a program- packages Reply with quote

We recently converted from plans to packages (or to be very specific, from using plans that contained DBRMS to using plans that contain packages).

In the past for a given CICS transaction or batch program it was easy to find out which tables were used by that program- I could look in SYSIBM.SYSTABAUTH with a query like

select tcreator,ttname,insertauth,selectauth,
updateauth, deleteauth from sysibm.systabauth where grantee= plan_name

But now we are using a "universal" plan- so I can't use this tack. I guess I could provide the package name in the grantee field but that means I need to know all the subroutines called by my main program and do each one in turn.

Is there some technique to "automate" this? So I can still provide the main program name and get a list of all tables used by it and the called subroutines (we do use dynamic invocation of subroutines for our batch programs btw)

Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Nov 16, 2011 6:37 pm    Post subject: Reply with quote

within the systabauth there must be some column that contains a value unique to applications / someway.

also, i don't care what method you use, plans w/dbrms or plans w/packages.
you should be able to find a module name someplace in systabauth
in the unlikely event that there actually are no module names in systabauth
which means that there are unique package names that relate directly to one and only one module

so you may have to create a cross-reference table

create and populate it with spufi

somewhere, someplace in your site, there is some magnetic media containing this cross-ref either intentially or as-a-result-of such as
A BIND LISTING
and then parse this with a rexx or program

and then run it regularly to stay up-to-date with development/maintenance changes

and then use a JOIN in your SELECT to allow yourself a WHERE clause that equates to your module name.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
GuyC
Supermod


Joined: 27 May 2011
Posts: 35
Topics: 0

PostPosted: Thu Nov 17, 2011 4:42 am    Post subject: Reply with quote

DBRM PLANs needed all DBRMs of main programs and subroutines.
Someone had to maintain this (just to issue the bind statement)
and it was reflected in SYSTABAUTH.
But this doesn't mean that DB2 magically knows which subroutines are used by a program.
Back to top
View user's profile Send private message
sumithar
Beginner


Joined: 22 Sep 2006
Posts: 84
Topics: 29

PostPosted: Thu Nov 17, 2011 7:08 pm    Post subject: Reply with quote

dbzTHEdinosauer wrote:
within the systabauth there must be some column that contains a value unique to applications / someway.

also, i don't care what method you use, plans w/dbrms or plans w/packages.
you should be able to find a module name someplace in systabauth
in the unlikely event that there actually are no module names in systabauth
which means that there are unique package names that relate directly to one and only one module

so you may have to create a cross-reference table

create and populate it with spufi

somewhere, someplace in your site, there is some magnetic media containing this cross-ref either intentially or as-a-result-of such as
A BIND LISTING
and then parse this with a rexx or program

and then run it regularly to stay up-to-date with development/maintenance changes

and then use a JOIN in your SELECT to allow yourself a WHERE clause that equates to your module name.


I guess I'm stupid since I don't follow most of what you have taken so much trouble to write. Are you saying I've to create a cross reference table of programs and the subroutines they call?
If that's what you intend I won't find this information in the DB2 catalog tables. Packages belong in collections that have no relation to program-subroutine hierarchy.
To create one would be a non-trivial task surely, I'd have to go thru all the source code members looking for CALL statements etc. etc.

And maintaining it would need to be a manual task- if I add a new subroutine to an existing program that won't be reflected in the catalog tables- a package is independent of plans.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Nov 18, 2011 12:10 am    Post subject: Reply with quote

Quote:

I guess I'm stupid since I don't follow most of what you have taken so much trouble to write.
Probably not stupid - just unaware of some things. . .

If it was completely easy (automagic) every place would have one Smile

Most places use some kind of configuration management tool to keep a usage crossreference.
_________________
All the best,

di
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Nov 18, 2011 7:03 am    Post subject: Reply with quote

you desire a method whereby you can select from sysibm.systabauth the tables a particular module accesses.

ok, fine.
before, the plan name was the same name as a module and the select was easy.

now, there is a different 'plan/package' name that refers to a module.

all i am suggesting is, create a cross reference of 'your module names' and the new 'plan/package names'.

you keep trying to differentiate between module and subroutine. why?

I have no idea what your set-up is like. only you know about your site.

i suggest that you have not investigated enough
i.e. talked to your dba to determine what their naming scheme is.

obviously you do not have a 'global' perspective of your system.
you have to acquire that before you can proceed.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sat Nov 19, 2011 12:21 am    Post subject: Reply with quote

Hi Dick,

Quote:

create a cross reference of 'your module names' and the new 'plan/package names'.
I believe this bit is undesirable.
Quote:

And maintaining it would need to be a manual task- if I add a new subroutine to an existing program that won't be reflected in the catalog tables- a package is independent of plans.

di
Back to top
View user's profile Send private message
sumithar
Beginner


Joined: 22 Sep 2006
Posts: 84
Topics: 29

PostPosted: Sat Nov 19, 2011 7:41 pm    Post subject: Reply with quote

dbzTHEdinosauer wrote:
you desire a method whereby you can select from sysibm.systabauth the tables a particular module accesses.

ok, fine.
before, the plan name was the same name as a module and the select was easy.

now, there is a different 'plan/package' name that refers to a module.

all i am suggesting is, create a cross reference of 'your module names' and the new 'plan/package names'.

you keep trying to differentiate between module and subroutine. why?

I have no idea what your set-up is like. only you know about your site.

i suggest that you have not investigated enough
i.e. talked to your dba to determine what their naming scheme is.

obviously you do not have a 'global' perspective of your system.
you have to acquire that before you can proceed.


OK, maybe I wasn't clear to begin with.

As you no doubt know, an executable Cobol program is made up of one main program and one or more subroutines. All are modules, in my perspective.
Earlier there was 1 single plan for the whole executable unit consisting of the DBRMs for the main program and the subroutines. So a batch program executed in a job has its own plan, each CICS transaction has its own plan. Hence identifying the tables used by a given CICS transaction or batch program is fairly straightforward.

Now, each of those "modules" has a matching package (which does have the same name as the module- so no confusion in that regard). But, there isn't a plan associated to the CICS tran or batch program anymore. There is one giant plan for the entire "system" as it were.

So, given a CICS transaction (and matching load module) or a batch program, how do I find all the tables used by the various packages that are tied to it since DB2 doesn't really store that kind of information anywhere?
And my source code management system doesn't store it either since we use dynamic linking wherever possible so the list of subroutines invoked by a main program is not available.

And yes I have spoken to the DBAs about this and they are looking into this as well- I'm jes' tryin' to help 'em as it were...
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sun Nov 20, 2011 12:20 am    Post subject: Reply with quote

Most of us understand what you want.

As has already been posted, this will probably take considerable (manual) effort to get the initial "version" of this matrix. After it is built, it will have to be kept current.

Some of the places i've supported have standards that all of this cross-reference material is kept in a separate database. Then a "where used" is simply a matter of running a query. Several of these places support applications on multiple platforms, but use a common repository to track "where-used".

Any time anything new is to be promoted, part of the promotion process is to ensure that any new pieces have been incorporated into the repository.

These organizations spent a lot of time and effort to develop these repository applications and consider them proprietary.
_________________
All the best,

di
Back to top
View user's profile Send private message
sumithar
Beginner


Joined: 22 Sep 2006
Posts: 84
Topics: 29

PostPosted: Sun Nov 20, 2011 5:16 pm    Post subject: Reply with quote

papadi wrote:
Most of us understand what you want.

As has already been posted, this will probably take considerable (manual) effort to get the initial "version" of this matrix. After it is built, it will have to be kept current.

Some of the places i've supported have standards that all of this cross-reference material is kept in a separate database. Then a "where used" is simply a matter of running a query. Several of these places support applications on multiple platforms, but use a common repository to track "where-used".

Any time anything new is to be promoted, part of the promotion process is to ensure that any new pieces have been incorporated into the repository.

These organizations spent a lot of time and effort to develop these repository applications and consider them proprietary.


Thanks papadi. If the only option is to maintain separately from the DB2 catalog then I don't see it happening in my shop- the person who manages our versioning and source-control s/w is very inflexible.

Oh well...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group