IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Source of Stored procedure.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jul 26, 2011 3:37 pm
Reply with quote

Hi,

As SYSIBM.SYSROUTINES table contains a row for each routine defined in the system. Mostly the routines are written in SQL or COBOL.

My question is where we can see the source code of the routines?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Jul 26, 2011 3:43 pm
Reply with quote

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.sqlref/zrout.htm
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jul 26, 2011 4:16 pm
Reply with quote

Thanks for the reply peter. The table - SYSIBM.SYSROUTINES doesnt contain the Source code for the routines. There is another catalog table - SYSIBM.SYSROUTINES_SRC. But it does not contain source code for all the routines. According to the manual - "SYSIBM.SYSROUTINES_SRC table
Contains source for generated routines, such as those created by DB2 UDB for z/OS Procedure Processor DSNTPSMP". We are using DB2 V8 for Zos.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Jul 27, 2011 3:09 pm
Reply with quote

No one is replying... icon_sad.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 27, 2011 3:24 pm
Reply with quote

Good spot...

Patience is a virtue.

PS. I have no idea myself.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 27, 2011 3:59 pm
Reply with quote

www.ibm.com/developerworks/data/library/techarticle/dm-0602rielau/
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Jul 27, 2011 5:32 pm
Reply with quote

Still not clear... Want to know which catalog table stores the source_code for the DB2 stored procedure...
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Jul 27, 2011 7:23 pm
Reply with quote

column text in SYSIBM.SYSROUTINES
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Wed Jul 27, 2011 7:25 pm
Reply with quote

Is the SP coded in SQL or in an external programming language?

If coded as an SQL procedure the source should be in SYSROUTINES_SRC.

If coded as COBOL or other programming language the source will likely be in whatever source library is used by your shop.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Jul 27, 2011 7:26 pm
Reply with quote

Quote:
Want to know which catalog table stores the source_code for the DB2 stored procedure...


I hope You realize that for odd requests not getting answers is pretty normal

remember...
replying is
on voluntary base
on our own time
the interest of the question asked
the knowledge/experience to provide a good reply

in this case most probably the last 2 apply
if You are really intereste better start searching Yourself
starting from ( for example ) here
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQK15/7.7?SHELF=DSNSHKA3&DT=20081120084907

Quote:
7.7.74 SYSIBM.SYSROUTINES table
7.7.75 SYSIBM.SYSROUTINESTEXT table
7.7.76 SYSIBM.SYSROUTINES_OPTS table
7.7.77 SYSIBM.SYSROUTINES_SRC table

might be tables worth investigating
Back to top
View user's profile Send private message
tp70227

New User


Joined: 20 Nov 2009
Posts: 3
Location: Hyd

PostPosted: Mon Aug 08, 2011 8:38 pm
Reply with quote

Hi,

check in BMC tool with type as PR and give the name of the stored procedure. IF bmc give you information then give "DDL" in the cmnd and it will take you to the defination of the stored procedure. Sometimes some company write stored procedure as cobol db2 batch module and so check in your changeman or whtever you are using for the source.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Aug 09, 2011 11:10 am
Reply with quote

Thanks everyone...
Back to top
View user's profile Send private message
apvardhini

New User


Joined: 23 Apr 2009
Posts: 20
Location: India

PostPosted: Tue Oct 07, 2014 3:15 pm
Reply with quote

Hi, when we download from BMC or create native sql stored procedure through SPUFI, the Sp is not indented properly. Why is it so and what is the workaround?
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Tue Oct 07, 2014 6:35 pm
Reply with quote

apvardhini,
Please start a new topic instead of adding onto a 3-yr old one.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
No new posts Executing DB2 SQL store procedure via... DB2 0
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Discrepancy between source code and o... COBOL Programming 7
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
Search our Forums:

Back to Top