Chapter Contents

Previous

Next
QUEUE_GETATT

QUEUE_GETATT



Obtain attachment information.


Syntax
QUEUE_GETATT Example

Syntax

CALL QUEUE_GETATT(queueId, status, attachId, atype, ainfo, aname, rc <, desc, minorVersion, majorVersion>);

Where... Is type... And represents...
queueId N queue identifier
status N status of parameter receipt
attachId N attachment identifier
atype C type of attachment
ainfo C library name or file specification
aname C member name or filename
rc N return code
desc C optional user-specified descriptive text
minorVersion N optional minor version
majorVersion N optional major version

When a message is surfaced by a query, the QUEUE_QUERY CALL routine returns a flag that indicates whether attachments were included with the message. If attachments were included with the message, QUEUE_GETATT can be invoked to obtain specific attachment information. QUEUE_GETATT returns information for one specific attachment.

The status parameter will have a value of 1 if this is the last attachment that was included with the message. Otherwise, it will have a value of 0.

The attachId parameter is returned and is the identifier that is used to uniquely identify each specific attachment. It can be used at a later time to indicate what attachments to actually accept.

The atype parameter specifies the attachment type. The ainfo and aname parameters will be set differently based on the attachment type.

DATASET or CATALOG
If the attachment is a catalog or a data set, the ainfo parameter will be the library name of the attachment. The aname parameter is the member name of the attachment.

EXTERNAL_TEXT or EXTERNAL_BIN
If the attachment is an external file (either binary or text), the ainfo parameter will be the file specification. It will have a value of either FILENAME or FILEREF. If ainfo is set to FILENAME, then the aname parameter will contain the attachment's physical filename. If ainfo is set to FILEREF, then the aname parameter contains the name of the fileref that defines the external file.

If an error or a warning condition is encountered, 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.

If the sender specified an attachment description, it is returned in the desc parameter.

If the sender specified a user-specifiable minor version number, it is returned in the minorVersion parameter.

If the sender specified a user-specifiable major version number, it is returned in the majorVersion parameter.


QUEUE_GETATT Example

This example obtains attachment information. Notice the use of the optional parameters on the second and third QUEUE_GETATT invocations.

call queue_query(queueId, etype, msgtype, 
                 attachFlag, rc);

if (etype = "DELIVERY") and 
   (attachFlag = 1) then do;

   status = 0;
   attachId = 0;
   desc=";
   call queue_getatt(queueId,  status, 
                     attachId, type, 
                     info, mem, rc);

      /**********************************/
      /* more attachment info to obtain */
      /**********************************/
   if (status = 0) then
      call queue_getatt(queueId, status, 
                        attachId, type, 
                        info, mem, rc, desc);

      /**********************************/
      /* more attachment info to obtain */
      /**********************************/
   if (status = 0) then
      call queue_getatt(queueId, status, 
                        attachId, type, 
                        info, mem, rc, desc,
                        minor);

end;


Chapter Contents

Previous

Next

Top of Page

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