Error calling program. Code: UNEXPECTED Msg: XML run loop fa

ed4355
Posts: 2
Joined: Fri Nov 13, 2015 2:37 pm

Re: Error calling program. Code: UNEXPECTED Msg: XML run loo

Post by ed4355 » Fri Nov 13, 2015 2:50 pm

Hi - just wondering if anyone ever resolved this. I'm getting similar results. When:

array('v5r4'=>false) = %parms is set to -1 in the procedure, but everything else works ok.

array('v5r4'=>true) = %parms is set correctly but the return value from the ILE procedure comes back as -1.

Here is the procedure interface:

Code: Select all

     d prtLblOrd       pi            10i 0                           
     d  pctlIn                       20    const varying             
     d  outqIn                       10    const varying             
     d  maxStatIn                     2    const                     
     d  rtnCodeOut                    3  0 options(*nopass: *omit)   
Here is the PHP:

Code: Select all

    // set array for input parms...
    $param[] = $conn->AddParameterChar('in', 20,'Order','pctlIn',$selectedPctl, 'on'); // 6th parameter is for varying
    $param[] = $conn->AddParameterChar('in', 10,'Outq','outqIn',$selectedOutq,'on'); // 6th parameter is for varying
    $param[] = $conn->AddParameterChar('in', 2,'Max Status','maxStatIn',$selectedMaxStat);
    $param[] = $conn->AddParameterPackDec('both', 3, 0, 'Return Code','rtnCodeOut',0);
    
    // set array for return value...
    $retParam[] = $conn->AddParameterInt32('out', 'Labels printed', 'nbrLabels', '0');
     
    // call service pgm...
    $conn->setOptions(array('v5r4'=>true));
    $result = $conn->PgmCall('OP903R', 'HOMPK320', $param, $retParam, array('func'=>'PRTLBLORD') );
    $conn->setOptions(array('v5r4'=>false));
    
    if ($result) {
        print_r($result);
    }
And here is the result:

Array ( [io_param] => Array ( [rtnCodeOut] => 0 ) [retvals] => Array ( [nbrLabels] => -1 ) )

When I change 'v5r4'=>false:

Array ( [io_param] => Array ( [rtnCodeOut] => 0 ) [retvals] => Array ( [nbrLabels] => 29 ) )

Post Reply