Chapter Contents

Previous

Next
_getfield

_getfield



Receive one or more parameters at a time.


Syntax
Example

Syntax

CALL SEND(cnctionInst, '_getfield', status, rc <, parm1...parmn>);

Where... Is type... And represents...
status N status of parameter receipt
rc N return code
parm1...parmn N or C parameters in which to receive the message; consists of 0 or more numeric or character variables

When a message is surfaced by a query, it must be received into SCL parameters. The _getfield method behaves like the _recv method in that it receives the message into SCL parameters. The two methods differ in that _recv requires that you receive the entire message at one time, while _getfield allows each parameter to be received separately. The _getfield method supports the receipt of numeric and character parameters, but it does not support the receipt of SCL lists. Use _getlist to receive SCL lists one at a time.

The status parameter has a value of 1 if this is the last parameter, indicating there are no additional parameters to retrieve. Otherwise, it has a value of 0.

If an error or warning condition is encountered during the receive, a non-zero return code is returned in the rc parameter. Use SYSMSG() to determine the exact error message.


Example

This example receives one parameter, then two parameters, then the last one.

name1 = '';
name2 = '';
name3 = '';
name4 = '';
call send(cnctionInst, '_getfield', 
          status, rc, name1);

if (status ne 1) and (rc eq 0) then
   call send(cnctionInst, '_getfield', 
             status, rc, name2, name3);

if (status ne 1) and (rc eq 0) then
   call send(cnctionInst, '_getfield', 
             status, rc, name4);

   /****************************************/
   /* If this is the last parameter to be  */
   /* received, status should have a value */
   /* of 1.                                */
   /****************************************/

if (status eq 1) and (rc eq 0) then
   /* All parameters have been received    */
   /* and can be used in processing.       */


Chapter Contents

Previous

Next

Top of Page

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