Chapter Contents

Previous

Next
QUEUE_GETFLD

QUEUE_GETFLD



Receive one or more parameters at a time.


Syntax
QUEUE_GETFLD Example

Syntax

CALL QUEUE_GETFLD(queueId, status, rc,
parm1 <, parm2,...,parmn>);

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

When a message is surfaced by a query, it needs to be received into variables. QUEUE_GETFLD behaves like QUEUE_RECV in that it receives the message into variables. The two CALL routines differ in that QUEUE_RECV requires that you receive the entire message at one time, while QUEUE_GETFLD allows each parameter to be received separately. QUEUE_GETFLD supports the receipt of numeric and character parameters.

The status parameter will have a value of 1 if this is the last parameter to receive. Otherwise, it will have 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 the SYSMSG() function to print the message that is associated with the non-zero rc.


QUEUE_GETFLD Example

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

name1 = '';
name2 = '';
name3 = '';
name4 = '';
status = 0;
call queue_getfld(queueId, status, rc, 
                  name1);

if (status ne 1) and (rc eq 0) then
   call queue_getfld(queueId, status, rc, 
                     name2, name3);

if (status ne 1) and (rc eq 0) then
   call queue_getfld(queueId, status, rc
                     name4);

/****************************************/
/* STATUS should be set to 1 if this is */
/* the last parameter to be received.   */
/****************************************/


Chapter Contents

Previous

Next

Top of Page

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