Chapter Contents

Previous

Next
_invokeMethod

_invokeMethod



Invokes method on remote instance.


Syntax
Example

Syntax

CALL SEND(robjInst, '_invokeMethod', return_list, rc);

Where... Is type... And represents...
return_list L SCL list of output/update parameters
rc N return code

_invokeMethod
invokes the method on the remote instance and passes to it all parameters that were defined by using the add argument methods.

return_list
is an SCL list that contains any output or update parameters that are returned by the remote method invocation. return_list parameter always contains the named item _MRC, which is the return code from the remote method invocation. _MRC indicates whether the remote method call was invoked without errors (syntax error or incorrect number of parms, and so forth). It does not indicate how the method ran. It only indicates whether it was invoked successfully. If _MRC is zero, the user can process return_list further to evaluate return parameters that might indicate how the method ran.

rc
is a return code that indicates success or failure. A zero value indicates success. A non-zero value indicates failure.


Example

This example illustrates the code to use for checking _MRC and displays all returned parameters in the return list.

rlist = makelist();
call send(robj, '_invokeMethod', rlist,rc);
if (rc eq 0) then do;

      /* get named item _MRC to determine if  */
      /* remote method invoked without syntax */
      /* error or wrong number of parms       */
   mrc = getnitemn(rlist, '_mrc', 1, 1, 0);
   if (mrc eq 0) then do;

         /* retrieve returned parms (and */
         /* optionally a name if it is a */
         /* named item) and dump to log  */
      do i = 1 to listlen(rlist);
         select( itemtype(rlist, i) );

            /* character parameter returned */
         when('C')
            do;
               cparm = getitemc(rlist, i);
               name='';
               name = nameitem(rlist, i);
               put 'Returned character parm is ' 
                  cparm name;
            end;

            /* numeric parameter returned */
         when('N')
            do;
               nparm = getitemn(rlist, i);
               name='';
               name = nameitem(rlist, i);
               put 'Returned numeric parm is' 
                  nparm name;
            end;

            /* list parameter returned */
         when('L')
            do;
               lparm = getiteml(rlist, i);
               name='';
               name = nameitem(rlist, i);
               put 'Returned list parm is' 
                  lparm name;
            end;
      end; 
   end; /* end if mrc eq 0 */
end; /* end if rc eq 0 */


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.