by pratap t » Thu Jun 13, 2019 6:10 pm
I would like to explain the flow before sharing the code.
COBOL -----> NATIVE Store procedure ------> DB2 UDF -----> NON Mainframe application.
COBOL CODE:
CALL 'WS-SP-NAME' USING <INPUT1> , <INPUT2>
Native store procedure:
CREATE PROCEDURE shema.XXXX
(
IN INPUT1 CCSID EBCDIC FOR SBCS DATA
,IN INPUT2 CCSID EBCDIC FOR SBCS DATA
)
APPLICATION ENCODING SCHEME EBCDIC
WITHOUT EXPLAIN
WITHOUT IMMEDIATE WRITE
WITHOUT KEEP DYNAMIC
ISOLATION LEVEL UR
OPTHINT ''
RELEASE AT COMMIT
REOPT NONE
VALIDATE RUN
ROUNDING DEC_ROUND_HALF_EVEN
DATE FORMAT ISO
DECIMAL( 15 )
FOR UPDATE CLAUSE REQUIRED
TIME FORMAT ISO
BUSINESS_TIME SENSITIVE NO
SYSTEM_TIME SENSITIVE NO
ARCHIVE SENSITIVE NO
APPLCOMPAT V10R1
BEGIN
DECLARE SQLCODE INTEGER;
DECLARE XXXX CURSOR WITH RETURN FOR
SELECT SCHEMA.DB2UDF STORED PROCDURE( INPUT1, INPUT2)
FROM SYSIBM.SYSDUMMY1;
OPEN XXXX;
END;
DB2 UDF stored procedure:
CREATE FUNCTION SCHEMA.DB2UDF STORED PROCEDURE
(
IN INPUT1,
IN INPUT2
)
RETURNS VARCHAR(5000)
NOT DETERMINISTIC
NOT SECURED
SPECIFIC STOREPPLREPORT
PARAMETER CCSID UNICODE
PARAMETER STYLE JAVA
EXTERNAL ACTION
EXTERNAL NAME 'JAVA PACKAGE WHERE METHOD RESIDES'
LANGUAGE JAVA
NO PACKAGE PATH
FENCED
NO SQL
NO DBINFO
NO SCRATCHPAD
NO FINAL CALL
NO COLLID
WLM ENVIRONMENT <wlm env name>
ASUTIME NO LIMIT
STAY RESIDENT NO
When we execute the store procdures through QMF we can able to connect to non mainframe application and able to perform required opertations.
Whereas when we invoke the same store procedure through cobol code we are experienceing error code as -471.
We have verified all possible reason for the error code, but not see issue with stored procedure and WLM(WORK LOAD MANAGER), both are up and availalbe.