In the following example, AS/400 program was described in the RPC-DTAQ configuration tool.
Program expects 5 parameters, mapped to WinDev variables OP1, STR1, OP2, STR2, OP3.
IF NOT ASPgmCall("*PGM/RPCSAMPLE", "", connect1, OP1, STR1, OP2, STR2, OP3) THEN
Error(ErrorInfo(errFullDetails))
END
For the following example, program description is stored on IFS file "/tmp/rpcsampl.pcml", in PCML format.
IF NOT ASPgmCall("/tmp/rpcsample.pcml", "", cnx, OP1, STR1, OP2, STR2, OP3) THEN
Error(ErrorInfo(errFullDetails))
END
PCML description can be created by AS/400 ILE compilers.
Example with RPG ILE compiler:
CRTRPGMOD … PGMINFO(*PCML) INFOSTMF('/tmp/rpcsample.pcml')
PCML syntax looks like this:
<pcml version="1.0">
<!-- PCML source for calling "RPCSAMPLE" program -->
<!-- Program "RPCSAMPLE" and its parameter list -->
<program name="RPCSAMPLE" path="/*LIBL.lib/RPCSAMPLE.pgm">
<data name="Op1" type= length="5" precision="2" usage="input"/>
<data name="Str1" type="char" length= usage="input"/>
<data name="Op2" type="packed" length="5" precision="2" usage="inputoutput"/>
<data name="Str2" type="char" length="30" usage="inputoutput"/>
<data name="Op3" type="packed" length="10" precision="4" usage="output"/>
</program>
</pcml>