I have a error when I run a stored procedure from java that call to a simple RPGLE program If I run the SP from DB2 (System I navigator) is success or If i run the rpgle program is as400 return ok but when the SP is running from java the first execution is ok, the second execution return a error (CEE9901 - Application error. *N unmonitored by *N at statement*IN. instruction X'4000) and I dont know why!. someone could help me?

this is my code SP

CREATE PROCEDURE WOOLB3.SP806012 ( IN TRAMA CHAR(62) , INOUT RPTA CHAR(1) , INOUT VALOR CHAR(15) ) LANGUAGE RPGLE SPECIFIC WOOLB3.SP806012 NOT DETERMINISTIC MODIFIES SQL DATA CALLED ON NULL INPUT EXTERNAL NAME 'WOOLB3/IR806012' PARAMETER STYLE GENERAL ; GRANT ALTER , EXECUTE ON SPECIFIC PROCEDURE WOOLB3.SP806012 TO GRPAYP ; GRANT ALTER , EXECUTE ON SPECIFIC PROCEDURE WOOLB3.SP806012 TO GRPCAL ; GRANT ALTER , EXECUTE ON SPECIFIC PROCEDURE WOOLB3.SP806012 TO PUBLIC ; GRANT ALTER , EXECUTE ON SPECIFIC PROCEDURE WOOLB3.SP806012 TO QPGMR ; 

JAVA

Connection conn = null; CallableStatement cs = null; StringBuffer sbSQL = new StringBuffer(); String valor = ""; try { log.info("Inicio-->SP806012"); conn = ResourceManager.getConnection(JNDIContext.JNDI_DATASOURCE_MCD); String esquema = FrameworkParameters.getValue(MCDConstant.ESQUEMA_RPG); sbSQL.append("{CALL ").append(esquema); sbSQL.append(".").append(MCDConstant.SP_OBTIENE_VALOR_CUOTA).append("(?,?,?)}"); cs = conn.prepareCall(sbSQL.toString()); System.out.println(trama); cs.setString(1, trama); cs.setString(2, MCDConstant.VACIO); cs.setString(3, MCDConstant.VACIO); cs.registerOutParameter(2, java.sql.Types.VARCHAR); cs.registerOutParameter(3, java.sql.Types.VARCHAR); cs.execute(); if (cs.getString(2).equals(MCDConstant.STRING_UNO)){ valor = (String)cs.getString(3).trim(); } log.info("Fin-->SP806012"); } catch (SQLException e) { e.printStackTrace(); throw new DAOException(e.getMessage(), e); } catch (Exception e) { e.printStackTrace(); throw new DAOException(e); } finally{ ResourceManager.callableStatementClose(cs); cs = null; ResourceManager.connectionClose(conn); conn = null; } return valor; 

RPGLE

 z-add *zeros v_cuota 11 2 z-add *zeros v_mdiferi 1 0 move '0' v_mdiferi 1 move *blanks p_fecvcto 8 eval ds_tarjeta = %trim(p_tarjeta) k_cs01p chain cs01pr 70 70 eval socic = '' EXSR sr_ObtRelDif eval p_fecvcto = fePROXVENC1(ds_tarjeta:v_mdiferi) eval v_cuota = fegetcuota(p_ncuota:p_fcompra: p_fecvcto:p_capital:p_tea:socic) v_cuota ifgt *zeros movel '1' p_rpta endif move v_cuota p_valor 
1

Related questions 0 Problems with Executing a DB2 External Stored Procedure 0 Error executing IBM DB2 Stored Proceedure in EJB container 0 Error -4304 when calling a Java stored procedure in DB2 Related questions 0 Problems with Executing a DB2 External Stored Procedure 0 Error executing IBM DB2 Stored Proceedure in EJB container 0 Error -4304 when calling a Java stored procedure in DB2 1 Trying to access AS400/DB2 stored procedure from Java with Spring JdbcTemplate 0 Invoking Stored Procedure from OracleJDBC giving exceptions 1 Calling SQL server 2008 Stored Procedure from Java 3 DB2 java Stored Procedure call return error SQLCODE=-440, SQLSTATE=42884 1 DB2 Java Stored Procedure NoSuchMethodError 1 Calling a stored procedure from db2 database to java code using spring 1 strange DB2 Exception while executing queries Load 7 more related questions Show fewer related questions

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.