DB2 STORED PROCEDURE FROM COBOL PROGRAM.

mallik vemugunta

DB2 STORED PROCEDURE FROM COBOL PROGRAM.
Hi,
 
  I am new to DB2 stored procedure , can you please help me how I can call COBOL CICS application program.
 
We already have a DB2 stored procedure that is being called from Java application and we had a requirement to call the same procedure from COBOL program, here is CREATE procedure syntax.
 
CREATE PROCEDURE ABC ( OUT SQLSTATE_OUT char(5),
                                             IN A char(4),
                                             IN B decimal(8,0),
                                             IN C char(3),
                                             IN D char(5),
                                             IN E char(3),
                                             IN F char(8) )
When I call using the below I am getting compilation error on SQLSTATE as undefined host variable where I defined SQLSTATE AS
 
EXEC SQL BEGIN DECLARE SECTION END-EXEC.           
    01 SQLSTATE PIC X(5).                          
EXEC SQL END DECLARE SECTION END-EXEC.    
 
Thanks,
Mallikarjun.         

 
EXEC SQL CALL ABC(:SQLSTATE,         
                                :A,            
                                :B,    
                                :C,        
                                :D,        
                                :E,        
                                :F)       
END-EXEC.                                          

 




_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.idug.org/solutions-journal.html - home of the IDUG Solutions Journal
Technical atricles from world famous authors in DB2's most prestigious, peer reviewed
magazine now on-line!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L