Chapter Contents

Previous

Next
_recvlist

_recvlist



Receive SCL lists.


Syntax
Example 1
Example 2

Syntax

CALL SEND(cnctionInst, '_recvlist', rc <, list1...listn>);

Where... Is type... And represents...
rc N return code
list1...listn L parameters in which to receive the SCL lists; consists of 0 or more SCL lists to receive into

When a message is surfaced by a query, it must be received into SCL parameters. _recvlist supports the receipt of SCL lists only. Use the _recv method to receive the message into numeric and character variables that are not SCL lists.

If an error or warning condition is encountered during the receive, a non-zero return code is returned in the rc parameter. The return codes that follow are a defined set of warning or error conditions that can be checked by using the SYSRC macro, which is provided in the autocall library that is supplied by SAS Institute.

If the rc is not one of the messages shown here, use SYSMSG() to determine the exact error message.

_SWTRUNC
is a WARNING that indicates the message has been truncated because too few parameters were passed into the _recvlist method. All parameters that were passed into the method will be updated, but the remainder of the message is truncated.

_SENOBUF
indicates that the receive failed because there is no message to receive.

_SEMORE
indicates that the receive failed because more receive parameters (list1...listn) were passed into _recvlist than were actually received. Parameters will NOT be updated and _recvlist must be called again to receive the lists.

If an unexpected message is received, _recvlist can be called by using 0 receive parameters in order to throw away the message. A truncation warning is returned, but the message will have successfully been received and truncated.


Example 1

This example receives two SCL lists.

attachlist = makelist();
header = makelist();

call send(cnctionInst, '_query', etype, 
          msgtype, header, attachlist, 
          rc);

if (etype eq "MESSAGE") then do;
      /**********************************/
      /* if message type is one, must   */
      /* receive two lists              */
      /**********************************/
   if (msgtype eq 1) then do;
      namelist = makelist();
      agelist = makelist();
      call send(cnctionInst, '_recvlist',
                rc, namelist, agelist);
   end;

      /**********************************/
      /* if message type is two, must   */
      /* receive one list               */
      /**********************************/
   else if (msgtype eq 2) then do;
      reports= makelist();
      call send(cnctionInst, '_recvlist', 
                rc, reports);
   end;

   else do;
         /*******************************/
         /* unexpected message;         */
         /* throw away message by       */
         /* forcing truncation          */
         /*******************************/
      call send(cnctionInst, '_recvlist', 
               rc);
   end;
end;


Example 2

This example throws the unexpected message away by forcing truncation.

call send(cnctionInst, '_recvlist', rc);


Chapter Contents

Previous

Next

Top of Page

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