PDA

View Full Version : Fehler bei Stored Procedure



peter.kinne
21-09-05, 10:17
Hallo zusammen,

wie haben eine StoredProcedure, die nach der Umstellung von AS/400 V5R1 nach i5 V5R3 die folgende Fehlermeldung bringt:

--------------------------------------------------------
ODBS Execute Error: Anwendungsfehler. RNX1216 nicht überwacht durch LEIP6100 bei Anweisung 0001000001, Instruktion X'0000'. [SQLCODE: -443 SQLSTATE: 38501]
--------------------------------------------------------

Kann jemand was damit anfangen ?

Gruß + Danke im voraus.

Peter Kinne

Fuerchau
21-09-05, 10:43
Nachrichten-ID . . . . . . . : RNX1216
Nachrichtendatei . . . . . . : QRNXMSG
Bibliothek . . . . . . . . : QSYS

Nachricht . . . : Fehlernachricht &5 wurde während &13 für Datei &7
angezeigt.
Ursache . . . . : RPG-Prozedur &1 in Programm &3/&2 hat die Nachricht &5
empfangen, während eine implizite Operation &13 für Datei &7 ausgeführt
wurde. Die tatsächliche Datei ist &8.
Fehlerbeseitigung: Das Jobprotokoll auf eine vollständige Beschreibung von
Nachricht &5 prüfen und den für die Programmpflege verantwortlichen Benutzer
benachrichtigen. Lautet der Eintrag für die Ein-/Ausgabeeinheit für die
Datei SPECIAL, ist unter Umständen keine Nachricht im Jobprotokoll
vorhanden.

Ich würde da im Joblog mal die Fehler prüfen !

TARASIK
21-09-05, 11:22
Hallo Peter,
obwohl damals für R510 ist es auch für R530 gültig:

PWS0005 Error When Stored Procedure Returns an Escape Message
Technote

Problem Description

After upgrading to R510 IBM OS/400, applications with External Stored Procedures that return escape messages may receive a PWS0005 "Error occurred in the OS/400 database server code " error message.

Problem Detail

OS/400 allows external procedures to return a custom error message in place of the generic SQL0443. The SQL reference states that the procedure needs to send an escape message to operating system program QSQCALL which invokes the procedure. QSQCALL will then map the error to SQLSTATE 38501 (SQLCODE -443) and return the specified message ID and text as the error message text.

For example, an ODBC application that calls a procedure that returns CPF9898 with replacement text of "1234567890" would receive the error:

szSqlState = "HY000",
*pfNativeError = -443,
MessageText = "[IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]CPF9898 - 1234567890."

Prior to R450 of OS/400, QSQCALL was implemented as a OPM program. In R510, QSQCALL is implemented as an ILE program. Depending on the programming language used for the external procedure and how the escape message is sent, the external procedure program may need to be modified.

For example consider a CL program that used the following in R450:
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
MSGDTA('My escape message') TOPGMQ(*PRV) +
MSGTYPE(*ESCAPE)

The help text for the SNDPGMMSG command states:
The message is sent to the message queue of the call stack entry that is immediately previous to the one identified by the second value. However, if the message queue immediately previous to the one identified by the Program or Qualified Procedures values is for an Integrated Language Environment (ILE) program entry procedure (PEP), the message is sent to the message queue that precedes the PEP message queue in the stack.

In R510, QSQCALL is an ILE PEP. Therefore, the message is sent to QZDASQL rather then QSQCALL resulting in the MSGPWS0005 error.

Problem Resolution

Modify the program to send the escape message to the proper program (QSQCALL). Each language has methods for signalling conditions and sending messages. Refer to the respective language reference to determine the appropriate way to signal a message.

In the example listed above, the CL program would need to be modified as shown below. Note that this works for all releases:
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
MSGDTA('my escape message') TOPGMQ(*SAME +
(QSQCALL)) MSGTYPE(*ESCAPE)