The php script calls the program as follows:
- Code: Select all
$desc = array (
array ("Name" => "type", "IO" => I5_IN, "Type" => I5_TYPE_CHAR, "Length" => "2" ),
array ("Name" => "memokey", "IO" => I5_IN, "Type" => I5_TYPE_CHAR, "Length" => "120" ),
array ("Name" => "htmldata", "IO" => I5_OUT, "Type" => I5_TYPE_VARCHAR, "Length" => "512" ) );
// Prepare the program...
$pgm = i5_program_prepare ( "basprogs/rsopenpst5", $desc );
if (! $pgm) {
echo "<br>Program prepare error. Error number =" . i5_errno () . " msg=" . i5_errormsg ();
}
The RPGLe procedure looks as follows:
- Code: Select all
D RSOPENPST5 pr ExtPgm( 'RSOPENPST5)' )
D P@TPME Const Like(TPMEMD)
D P@KEYX Const Like(KEYXMD)
D P@HtmlData 512a Varying
The code results in
Program call error. Error number=312 msg=UNEXPECTED
In this case I could change the code to fixed length variables, but this shouldn't be necessary i.m.h.o.
Anybody having the same problem or a clue how to avoid the problem with variables with a varyable length?
I attached the Toolkit's debug output, in case anybody reading is able to fix this problem, or point out what I am doing wrong here.

