View previous topic :: View next topic
|
Author |
Message |
kalais
New User
Joined: 18 Apr 2006 Posts: 22
|
|
|
|
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 |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
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 |
|
|
jaspal
New User
Joined: 22 May 2007 Posts: 68 Location: mumbai
|
|
|
|
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 |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
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 |
|
|
|