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
This topic is locked: you cannot edit posts or make replies. Need help - DB2 Dynamic SQL Program e... NikhilGuptaGaya DB2 6 Sat Jun 23, 2018 1:58 pm
This topic is locked: you cannot edit posts or make replies. Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm
No new posts VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm

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