Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Stored Procedures Input Parameters

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

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Tue May 12, 2009 6:22 pm    Post subject: DB2 Stored Procedures Input Parameters
Reply with quote

Hi,
We are writing DB2 Stored Procedures for the 1st time. The system in which the DB2 Stored Procedures are written will be in COBOL and the calling system is a .Net system and further it is an external application to my application.
Now my question is:
1. What all parameters do i need to fetch as input for my Stored Proc.
For e.g if i want information for Employee ID, then will Employee ID be the only input to the Stored Proc or there will be other parameters as well?
2. I know that we just have to declare and open the Stored Proc and not do a fetch on the Cursor. Now if i face some error in the Open of the SQL Statement, then will my SQL Error Message length be the same as in normal SQL Error Codes i.e SQLCA?
3. How do i display the Error Messages encountered? Through the normal "DISPLAY" statement of COBOL or is there something else?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue May 12, 2009 6:28 pm    Post subject:
Reply with quote

DB2 for z/OS Stored Procedures: Through the CALL and Beyond
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri May 15, 2009 4:09 am    Post subject:
Reply with quote

In addition, there are examples at the REDBOOKs site for stored procedures,
in COBOL, C, REXX, SQL Procedure Language, DDL, JCL,
the url for the additional material for z/OS Stored Procedures is
ftp://www.redbooks.ibm.com/redbooks/SG247083
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Fri May 15, 2009 9:23 am    Post subject:
Reply with quote

Hi Dino,
I am unable to open the FTP link. Meanwhile i am going through the whole PDF document.
Thanks!!!
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Fri May 15, 2009 10:54 am    Post subject:
Reply with quote

Hi,
I went through the document -Through the Call and Beyond.
It was quite informative.
But i am still unable to find the answer to one of my question:
"If i am declaring my Stored Procedures in Cobol, then do the calling program which is in .Net have the same parameters definition as in the COBOL Stored Proc? If yes, then how do we pass the packed decimal variables?"
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri May 15, 2009 12:58 pm    Post subject:
Reply with quote

Suggest yuo go through some already available DB2 Store Proc at your shop-- not necessarily the one one which belongs to your team.
Quote:
1. What all parameters do i need to fetch as input for my Stored Proc. For e.g if i want information for Employee ID, then will Employee ID be the only input to the Stored Proc or there will be other parameters as well?
This depends on your application requirement-- no way I can tell from here what is needed and what is not, probabley no one can.
Quote:
I know that we just have to declare and open the Stored Proc
icon_confused.gif, You don't do that, unless I misunderstood.
Quote:
do a fetch on the Cursor.
Yes the only and probably the best way-- you have to have cursors.
Quote:
Now if i face some error in the Open of the SQL Statement, then will my SQL Error Message length be the same as in normal SQL Error Codes i.e SQLCA?
Don't worry about this-- you are still using SQL, same rules will be applied.
Quote:
3. How do i display the Error Messages encountered? Through the normal "DISPLAY" statement of COBOL or is there something else?
ah..this is site specific question, though I'll try to put up a general interpretaion-- Error messages if they are related to front end such as, in your case, entered Employee ID is wrong-- this should be reflected on Front-end screen, there is no meaning of showing this error only in the SYSOUT. And this "error-message" become the "output from SP".

If there is some other error, say some SQL code -904 comes and you pop-up this mesage"SQL code -904" on front end screen-- this will give a technically correct but a vague information to the "user"-- better you display this SQL code in SYSOUT and on front end throw some "manager understandable ( icon_wink.gif ) message, such as "Execution is not successful because the call to database was not complted. Get in touch with “some” support."

Hope this helps . . .
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
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Getting Mutiple input from Panels vidyaa CLIST & REXX 12 Mon Aug 14, 2017 1:28 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Need input in Scheduling Benchwarmer CA Products 5 Tue Jun 06, 2017 1:44 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us