I5_TYPE_VARCHAR and Compatibility Wrapper

I5_TYPE_VARCHAR and Compatibility Wrapper

Postby nl059810 on Sun Jan 27, 2013 8:27 pm

I have a script changed that used to work with the Easycom Toolkit, which is now resulting in a program error using the Compatibility Wrapper.

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.
Attachments
debug.log
(476.94 KiB) Downloaded 101 times
Henri Timmermans, Software Engineer at FH Holding BV
Internet : http://www.exa-holding.com
LinkedIn: http://www.linkedin.com/pub/henri-timmermans/14/b39/236
nl059810
 
Posts: 13
Joined: Thu Sep 03, 2009 10:29 pm

Re: I5_TYPE_VARCHAR and Compatibility Wrapper

Postby aseiden on Tue Jan 29, 2013 10:59 pm

Yes, you're right. The Compatibility Wrapper doesn't account for I5_TYPE_VARCHAR. (Though the new API does) I'll take a look at this in the CW and report back here on the forum.

Alan
aseiden
 
Posts: 829
Joined: Thu Apr 09, 2009 5:45 pm

Re: I5_TYPE_VARCHAR and Compatibility Wrapper

Postby nl059810 on Tue Jan 29, 2013 11:09 pm

Alan,

Thanks. If I encounter more programs we use, I'll change them to fixed character if possible. If in the meantime a new version of CW is available that does accept varchar, I'll install that fix.
Henri Timmermans, Software Engineer at FH Holding BV
Internet : http://www.exa-holding.com
LinkedIn: http://www.linkedin.com/pub/henri-timmermans/14/b39/236
nl059810
 
Posts: 13
Joined: Thu Sep 03, 2009 10:29 pm


Return to New Toolkit

Who is online

Users browsing this forum: No registered users and 2 guests