Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Table with Relationship between DB2table and Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Mon Jun 26, 2006 6:08 pm    Post subject: Table with Relationship between DB2table and Program
Reply with quote

Hi,
Is there any system table in DB2 which maintains the relationship between Programs and the DB2 tables that are being accessed through that program?

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

rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Jun 27, 2006 8:33 pm    Post subject:
Reply with quote

I believe these linking process will be done during precompilation..but i presume there is no system table which maintains these information...


Regards
jai
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Wed Jun 28, 2006 2:00 am    Post subject:
Reply with quote

Quote:
Is there any system table in DB2 which maintains the relationship between Programs and the DB2 tables that are being accessed through that program?


the relationship is stored in the the dbrm which is a prt of u r plan
Back to top
View user's profile Send private message
Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Wed Jun 28, 2006 1:11 pm    Post subject: Re: Table with Relationship between DB2table and Program
Reply with quote

select *
FROM SYSIBM.SYSPACKDEP
where DNAME = 'program name' and BTYPE = 'T'
Back to top
View user's profile Send private message
ravi17s
Warnings : 1

New User


Joined: 15 Aug 2003
Posts: 57

PostPosted: Thu Jun 29, 2006 5:16 pm    Post subject: Re: Table with Relationship between DB2table and Program
Reply with quote

If your are not using an Package Try this also...
SYSIBM.SYSPLANDEP

SELECT *
FROM SYSIBM.SYSPLANDEP
where DNAME = 'program name' and BTYPE = 'T'

Thanks,
Ravi.
Back to top
View user's profile Send private message
senthilssg

New User


Joined: 09 Dec 2005
Posts: 64
Location: USA

PostPosted: Thu Jun 29, 2006 8:25 pm    Post subject:
Reply with quote

Hi,

The following query is applicable when your program name and plan are same. (I.e. you?re each program having separate plan and name of the both should be same)

Code:
SELECT * FROM SYSIBM.SYSPLANDEP
WHERE DNAME = 'program name' and BTYPE = 'T'


Actually, having separate plan for each program is not a usual practice and not a good practice. Most of the application program is bind with package after that it bound with plan. So we can very well go with the SYSIBM.SYSPACKDEP table for the getting the info about relation between the program and table.


The following query will give the details which you wanted

Code:
SELECT BNAME  TABLE_NAME , BQUALIFIER QUALIFIER,
 DNAME  PROGRAM_NAME 
FROM SYSIBM.SYSPACKDEP WHERE BTYPE = 'T' AND BQUALIFIER='qualifier' AND DNAME=?programname?;



this is the sample output of above query

Quote:
-----------------------------------------------------------------------------
TABLE_NAME QUALIFIER PROGRAM_NAME
-----------------------------------------------------------------------------

EMP11 SSGSEN COBSTPR1
SYS_TABLE SSGSEN TRIGDATE
-----------------------------------------------------------------------------




Correct me if I am wrong


Regards

Senthil
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us