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
 
How to call COBOL program from a COBOL stored procedure.

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

New User


Joined: 18 Apr 2006
Posts: 22

PostPosted: Wed Jul 23, 2008 1:08 pm    Post subject: How to call COBOL program from a COBOL stored procedure.
Reply with quote

Hi,

I am trying to call a COBOL program from a DB2 stored procedure written in COBOL. How I can achieve this? I need some sample code for this.

And I also need sample code/references on calling stored procedure routine from a stored procedure. Both SPs are in COBOL.



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

Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Wed Jul 23, 2008 7:09 pm    Post subject:
Reply with quote

Calling a COBOL program from a Stored Procedure is similar to Calling COBOL program from a COBOL program. The syntax remains the same.

Stored Procedure - PGMA
COBOL Program - PGMB

PGMA
CALL PGMB using parm1, Parm2

But one thing we need to take care here that both the programs should be bound under same plan.
Back to top
View user's profile Send private message
jaspal

New User


Joined: 22 May 2007
Posts: 68
Location: mumbai

PostPosted: Fri Jul 25, 2008 10:22 pm    Post subject:
Reply with quote

Hi,

why you need to call a cobol component from Stored procedures.
Stored procedures is structured query language (SQL) programs that are stored at the DB2 server .
if you will call a cobol component from stored procedure there i think you are giving heads up to DB2 subsystem.....why can't you do processing over there in stored procedure itself ( i.e computation etc ) .


Thanks,
Jaspal
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Fri Jul 25, 2008 11:33 pm    Post subject:
Reply with quote

Hi Jaspal,

You can do it in either way.

Usually COBOL program would be a common routine that can be called from Many Stored Procedures.

For example something like date validation routine or any conversion routine which would be used by multiple stored procedure, it can be placed in a COBOL program.

For creating SP, we need to define the SP definition and create it, provide access to all the user whoever accessing the SP and everytime if want to add/modify any parameter, we need to change the definition of the SP.

In our project, we used to have COBOL program, in case of any common routines rather than using a Separate SP.

Suggestions are welcome.
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 The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am

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