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

How to call another para in the native sql procedure


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Mon Aug 09, 2010 3:50 pm
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
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

Moderator Emeritus


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

PostPosted: Tue Aug 10, 2010 7:56 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Programa para Realiza Operaciones sob... JCL & VSAM 3
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Batch call online program, EXCI task ... CICS 3
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
Search our Forums:

Back to Top