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
 

 

How to call another para in the native sql procedure

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

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Mon Aug 09, 2010 10:14 am    Post subject: How to call another para in the native sql procedure
Reply with quote

All,

Currently Iam in conversion of COBOL to Native SQL stored procedure for ZIIP processor usage.

Iam facing the following issue in this.

In COBOL we have lots of para which are called when ever it is required. Equivalent of para's available in native SQL is labels.

but how to call the labels other than GOTO statement.

Below is the example of the the scenario

Create procedure PROCEDURE1(OUT B INT)
LANGUAGE SQL
READS SQL DATA
DISABLE DEBUG MODE
DYNAMIC RESULT SETS 1

P1: BEGIN

SET B = 1;
I need to call the procedure B to perform some actions . Goto is the one which I have found with redbooks. Is there any other way to the call the label.


END P1
P2: BEGIN
SET B = B*2;
END P2

Thanks in advance for your help
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Aug 09, 2010 3:50 pm    Post subject:
Reply with quote

perhaps instead of imbedding 'paragraphs to be performed'
create additional SP's to be CALLed.
Back to top
View user's profile Send private message
r2k1984

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Tue Aug 10, 2010 11:46 am    Post subject:
Reply with quote

But there are lots of paragraphs in the cobol code . Which are been called multiple times.

If we create a stored procedure for each para, we will end up in multiple stored procedures. Which the DBA is not preferring.

Is there any other ways?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 10, 2010 7:56 pm    Post subject:
Reply with quote

Hello,

It is quite common for a process to utilize multiple Stored Procedures. . .

Quote:
Which the DBA is not preferring.
Then this dba should tell you what you need to do. . .
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 Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Need help in triggering a PL1 module ... Varungv99 IMS DB/DC 0 Fri Apr 07, 2017 10:01 am
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am


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