This works using net.data:

begin callcmd.mac===============
%DEFINE {
astring = "xx"
bstring = "xxxxxxxxx"
cstring = "xxxx"
ID = "xxxxxxxxxxx"
%}

%{************************************************ ********
Call the command.
************************************************** ******%}

%FUNCTION(DTW_DIRECTCALL) sys1 (IN char(2) astring, char(9) bstring,
char(4) cstring, OUT char(11) ID) {
%EXEC {
/QSYS.LIB/KNATIVE.LIB/SXURF3.PGM
PARM($(astring) $(bstring) $(cstring) $(ID))
%}

%MESSAGE {
default: "" : continue
%}
%}

%HTML(list) {
<P>Calling /QSYS.LIB/KNATIVE.LIB/SXURF3.PGM (astring
bstring
cstring
'$(ID)')</p>
<P>Before ID = "$(ID)"</p>
@sys1(astring, bstring, cstring, ID)
<P>After ID = "$(ID)"</p>
%}
end callcmd.mac===============

When I try to create a stored procedure and call it from PHP like this:

begin call_proc.php===================
$create = "CREATE PROCEDURE SXURF3 ";
$create .= "(IN CHAR(2), IN CHAR(9), IN CHAR(4), OUT CHAR(11) ) ";
$create .= "EXTERNAL NAME SXURF3 ";
$create .= "LANGUAGE RPGLE ";
$create .= "PARAMETER STYLE GENERAL WITH NULLS ";
$create .= "NO SQL ";
if ($debug) { echo("create = $create<br/>\n"); }
$creResult = odbc_exec($as400connectResult,"{$create}");
$error = odbc_error($as400connectResult);
$errormsg = odbc_errormsg($as400connectResult);
if (!$creResult) {
echo("$create<br/>\nNOT OK - eserver=$eserver<br/>\n($as400connectResult):<br/>\n");
echo("($error)<br/>\n $errormsg<br/>\n");
exit;
}
$call = "CALL SXURF3('$P1','$P2','$P3','$URF1')";
if ($debug) { echo("call = $call<br/>\n"); }
$callResult = odbc_exec($as400connectResult,"{$call}");
$error = odbc_error($as400connectResult);
$errormsg = odbc_errormsg($as400connectResult);
if (!$callResult) {
echo("$call<br/>\nNOT OK - eserver=$eserver<br/>\n($as400connectResult):<br/>\n");
echo("($error)<br/>\n $errormsg<br/>\n");
exit;
}
begin call_proc.php===================

I get this error:

begin error==================
CALL SXURF3('','','','xxxxxxxxxxx')
NOT OK - eserver=WICA-PGROUP
(Resource id #1):
(S1000)
[IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL0469 - IN, OUT, or INOUT not valid for parameter 4 in procedure SXURF3 in *N.
end error===================

It doesn't matter if I make the 4th parameter IN or OUT or INOUT.

Has anyone gotten this to work?
Thanks,
Jim...