How do you have the OUT variable defined in the RPG, is it varying? Where in the RPG do you get the error. We need to see how you are calling the procedure in the RPG and how the variables are defined.
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Wednesday, September 03, 2014 1:27 PM
To: Midrange Systems Technical Discussion
Subject: Problem with EVAL of SQL proc
CREATE PROCEDURE TEST/GETLIB
(IN out_loc CHARACTER (4),
OUT div_lib VARCHAR(10)
READS SQL DATA
SELECT MAX(lclib) INTO div_lib
WHERE lcwhse = out_loc
AND lcbas IN ('S','V');
I have GETLIB in debug break on END P1
This works as I expect: EVAL *GETLIB.OUT_LOC:S
Returning: *GETLIB.OUT_LOC:S = "82 "
This fails: EVAL *GETLIB.DIV_LIB:S
As does this: EVAL *GETLIB.DIV_LIB:C
And this: EVAL *GETLIB.DIV_LIB:x 10
All return: Pointer type error occurred.
This does 'work' (kinda): EVAL %localvars
argc = 4
argv = SPP:FDF64C5B78009BE0
GETLIB.OUT_LOC = SPP:FDF64C5B78009CE0
GETLIB.SQLP_I1 = 0
GETLIB.DIV_LIB.LEN = 10
GETLIB.DIV_LIB.DAT = SPP:FDF64C5B78009CE8
Thanks to Chuck for the hint about typing HELP on the debug cmd line, but I did not see anything like VARCHAR - but apparently DIV_LIB is NOT a 'string' type ? and GETLIB.DIV_LIB.DAT, using my System/370 Reference Summary, does not decode into anything meaningful to me.
After about 10 presses of F10 I return to my SQLRPGLE where, surprisingly SQLCOD = 0, but, not surprisingly, the library name returned is blank.
Additional Message Information
Message ID . . . . . . : CPF7E18 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 09/03/14 Time sent . . . . . . : 13:00:13
Message . . . . : Pointer type error occurred.
Cause . . . . . : The identifier in position 21 of the input buffer is not a