Chapter Contents

Previous

Next
_acceptAttachment

_acceptAttachment



Receives attachments.


Syntax
Example 1
Example 2

Syntax

CALL SEND(cnctionInst, '_acceptAttachment', attachlist, rc <, attribs>);

Where... Is type... And represents...
attachlist L list of attachments to receive
rc N return code
attribs C (optional) attributes

When invoked on a Cnction instance, _acceptAttachment indicates which, if any, attachments are to be received.

When a query surfaces a message event, it also surfaces an attachment list if an attachment list was included with the message. Only the attachment list is surfaced by the query, no attachments have actually been transferred at this point. Therefore, the user must indicate which, if any, attachments should be transferred using the _acceptAttachment method. See Accepting Attachments for more information.

If an attachment list is surfaced by the query, _acceptAttachment must be called with the COMPLETE attribute before subsequent sends and/or queries will be allowed. This attribute indicates the completion of attachment receipt. Even if no attachments are to be transferred, _acceptAttachment with the COMPLETE attribute must be called to indicate completion.

If an error or warning condition is encountered during attachment transfer, a non-zero return code is returned in the rc parameter. The return codes that follow are a defined set of warning and 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 different from the message shown here, use SYSMSG() to determine the exact error message.

_SWATTXF
is a WARNING that indicates that not all attachments were transferred successfully. See Attachment Error Handling for more information.


Example 1

This example accepts two attachments. Setting the COMPLETE flag indicates that attachment transfer will be complete after these 2 attachments are received.

alist = makelist();

   /*************************************/
   /* attachment one will be placed     */
   /* in the file WORK.ABC              */
   /*************************************/
att1 = makelist();
rc = setnitemn(att1, 1, "ATTACH_ID");
rc = setnitemc(att1, "WORK", "OUTLIB");
rc = setnitemc(att1, "ABC", "OUT");

   /*************************************/
   /* attachment two is an external     */
   /* file and will be placed in        */
   /* /tmp/text.file                    */
   /*************************************/
att2 = makelist();
rc = setnitemn(att2, 2, "ATTACH_ID");
rc = setnitemc(att2, '/tmp/text.file', 
               "OUTFILE");
rc = insert1(alist, att1);
rc = insert1(alist, att2);
call send(cnctionInst,'_acceptAttachment',
          alist, rc, "COMPLETE");


Example 2

In this example, no attachments will be received; however, _acceptAttachment using the COMPLETE attribute must be called to indicate completion.

call send(cnctionInst,'_acceptAttachment',
          0, rc, "COMPLETE");


Chapter Contents

Previous

Next

Top of Page

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