Calling *srvpgm function with options(*nopass)

Discussion in 'PHP Toolkit' started by Dick Donohue, Jan 3, 2018.

  1. Dick Donohue

    Dick Donohue New Member

    I need help.
    I'm trying to use the PHP Toolkit to call a function in a *srvpgm (rpgle) in which the last parm is specified with "options(*nopass)". I get all the values passed back in the ['io_param'] array -- except for the parms that are specified with *nopass. And I don't get anything in the ['retvals'] array either (it is supposed to return an indicator).

    *SRVPGM function code looks something like this:
    Code (Text):

    dcl-proc ETMBRSRV;
    dcl-pi *n ind;
        peInputID CHAR(15) const;
        peUnique  CHAR(15);
        peName    CHAR(20)  options(*nopass);
    end-pi;
    //  some other code then...
    If %Parms >= %ParmNum(peName);
      peName = wwName;            
    EndIf;      
     

    php code looks something like this:
    (yes, the function name is the same as the service program name.. I didn't write it!)

    PHP:

    $parms[] = $this->toolkit->AddParameterChar('in', 15, 'InputID', 'InputID', '123456');
    $parms[] = $this->toolkit->AddParameterChar('both', 15, 'UniqueID', 'UniqueID', ' ');
    $parms[] = $this->toolkit->AddParameterChar('both', 20, 'name', 'name', 'put name here');
    $retParms = array();
    $result = $this->toolkit->PgmCall('ETMBRSRV', '*LIBL',$parms, $retParms, array('func' => 'ETMBRSRV'));
     

    I get back something like this in the $result var:
    Code (Text):

    Array
    (
        [io_param] => Array
            (
                [UniqueID] => 010580124598
                [name] => put name here
            )
        [retvals] => Array
            (
            )
    )
     

    Note: whatever I put in the name parameter comes back.
     
    Last edited: Jan 3, 2018

Share This Page