Hmmmmmmm should work in this way.
What exactly is the SQLCODE or SQLSTATE after the CALL?
Are all PTFs installed?
Mit freundlichen Grüßen / Best regards
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Matt
Olson via MIDRANGE-L
Sent: Donnerstag, 26. Dezember 2019 18:04
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: Matt Olson <Matt.Olson@xxxxxxxx>
Subject: Calling a stored procedure from RPG
Does anyone know how to call a SQL Stored procedure from RPG and pass in
integer and receive the response back in the output variable?
We are having an issue where the input parameter doesn't appear to be mapped
to the input parameter (RTID), and the CREDSTRING output variable is always
We are able to successfully call the procedure using straight SQL. It just
doesn't work from RPG.
Here is the SQL Stored procedure def:
CREATE PROCEDURE TESTLIB.GETCREDSTRING (
IN RTID INTEGER ,
OUT CREDSTRING VARCHAR(50) )
MODIFIES SQL DATA
CALLED ON NULL INPUT
SET OPTION ALWBLK = *ALLREAD ,
ALWCPYDTA = *OPTIMIZE ,
COMMIT = *NONE ,
DECRESULT = (31, 31, 00) ,
DFTRDBCOL = TESTLIB,
DYNDFTCOL = *NO ,
DYNUSRPRF = *USER ,
SRTSEQ = *HEX
One input parameter RTID (integer), and one output parameter (credstring)
Our RPG program is as follows:
CTL-OPT DATFMT(*USA) DEBUG(*YES) DFTACTGRP(*NO) ALWNULL(*USRCTL);
DCL-S InParm int(10);
DCL-S OutParm VARCHAR(50);
InParm = 0000600002;
call getcrdsp (:Inparm, :Outparm);
*INLR = *ON;
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
As an Amazon Associate we earn from qualifying purchases.