0

I´ve been trying to call a Package from a Stored Procedure, but I'm not able to.

I tried to create it as below:

CREATE PROCEDURE DGOWNDB.ZHG0002I                                        
    (IN  col1       CHAR (03)      FOR SBCS DATA CCSID EBCDIC,    
     IN  col2       CHAR (20)      FOR SBCS DATA CCSID EBCDIC,    
     IN  col3       CHAR (03)      FOR SBCS DATA CCSID EBCDIC)    
    DYNAMIC RESULT SETS 1                                                
    NOT DETERMINISTIC                                                    
    LANGUAGE COBOL                                                       
    FENCED                                                               
    WLM ENVIRONMENT ENVWLM                
    BEGIN                              
    EXTERNAL NAME 'PHGS222E'                                       
;                 

                                               

I'm getting the Db2 error code -444, saying that it's not able to found the package

DSNT408I SQLCODE = -444, ERROR:  USER PROGRAM PHGS222E COULD NOT BE FOUND
DSNT418I SQLSTATE   = 42724 SQLSTATE RETURN CODE                         
DSNT415I SQLERRP    = DSNX9CAC SQL PROCEDURE DETECTING ERROR             
DSNT416I SQLERRD    = 0  0  0  -1  0  0 SQL DIAGNOSTIC INFORMATION       
DSNT416I SQLERRD    = X'00000000'  X'00000000'  X'00000000'  X'FFFFFFFF' 
         X'00000000'  X'00000000' SQL DIAGNOSTIC INFORMATION            

I've tried to use both SET CURRENT PACKAGESET and CURRENT PACKAGE PATH special register but had no success.

I've tried to search but didn't find anything that helped. Insight from others is welcome.

Regards

Hogstrom
  • 3,581
  • 2
  • 9
  • 25
Ricardo Pinto
  • 333
  • 1
  • 2
  • 11
  • How are you CALLing the cobol procedure? give details (do you use the qualified name or unqualified name)? . If you use the unqualified name, have you set the SQL path (function path)? Please edit your question to show how you compiled /linked/bound the cobol procedure source code, and how you compiled and linked the calling application. – mao Sep 07 '21 at 18:55
  • Hello Mao, i'm trying to call it throuht Db2 Admin for testing purposes, I do use a qualified name, I do not know how the cobol program was compiled because it wasn't me who did it, I'm only trying to call it through a Stored Procedure – Ricardo Pinto Sep 07 '21 at 20:59

0 Answers0