SQLCODE = -471, ERROR: INVOCATION OF FUNCTION OR PROCEDURE



IBM's flagship relational database management system

SQLCODE = -471, ERROR: INVOCATION OF FUNCTION OR PROCEDURE

Postby pratap t » Thu Jun 13, 2019 3:02 pm

Hello All,

Subject : We are getting some issue while calling Non mainframe application from mainframes.
Intension : We are trying to send data from mainfames DB2 UDF to non-mainframe application.
Note : There are ways to send data from mainfram to non mainframes. So we have choosen DB2 UDF function will be the best one.

Result :
Intance 1: When we send data thru QMF, then we can able to send data from mainframes to non-mainframes. (Manual operation)

Instance 2 : When we try to send data using Cobol, then we are getting error like below.
Error :
SQLCODE = -471, ERROR: INVOCATION OF FUNCTION OR PROCEDURE. SQLSTATE = 55023 SQLSTATE RETURN CODE
pratap t
 
Posts: 2
Joined: Thu Jun 13, 2019 2:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SQLCODE = -471, ERROR: INVOCATION OF FUNCTION OR PROCED

Postby NicC » Thu Jun 13, 2019 5:15 pm

And your code is? And your DBA says?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: SQLCODE = -471, ERROR: INVOCATION OF FUNCTION OR PROCED

Postby 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.
pratap t
 
Posts: 2
Joined: Thu Jun 13, 2019 2:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SQLCODE = -471, ERROR: INVOCATION OF FUNCTION OR PROCED

Postby chrisf » Fri Jun 28, 2019 12:23 pm

Has the user of the batch job all privileges to execute stored procedure, dsnr batch and the udf?

the WLM Applenv is up and running? (d wlm,applenv=xyz) and the function is up and running (-dis func(xyz))
chrisf
 
Posts: 1
Joined: Fri Jun 28, 2019 12:18 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post