In the following example,
one attachment is accepted into a non-existent library name:
/* build one attachment list, att1
*/
att1 = makelist();
rc = setnitemc(att1, 1, "ATTACH_ID");
rc = setnitemc(att1, "NOEXIST", "OUTLIB");
rc = setnitemc(att1, "A , "OUT");
/* insert att1 into the main attachment list, alist */
alist = makelist();
alist = insertl(alist, att1, -1);
/* accept the attachment */
call send(obj, "_ACCEPT_ATTACHMENT_", alist, rc);
/* if error, dump out attachment list to view rc */
if (rc NE 0) then
call putlist(alist, "Attachment
list after accept:", 1);
After the accept method
call, the attachment list alist has the following named items:
-
Named item ATTACH_ID has a value
of 1.
-
Named item OUTLIB has a value of
"NOEXIST."
-
Named item OUT has a value of "A."
-
Named item RC has a value of 81.
The error code list
maps the return code of 81 into output library is nonexistent. Similarly,
when the sender returns from the _SEND_ or _SENDLIST_, the attachlist
parameter is updated with the RC named item to reflect that the attachment
transfer failed.
att1 = makelist();
rc = setnitemc(att1, "SASUSER", "LIBNAME");
rc = setnitemc(att1, "NAMES", "MEMNAME");
rc = setnitemc(att1, "DATASET", "TYPE");
attachlist = makelist();
attachlist = insertl(attachlist, att1, -1);
call send(cnctionObj, "_SEND_", msgtype, attachlist,
rc, "Message One");
if (%sysrc(_SWATTXF) = rc) then do;
call putlist(attachlist, "attachlist after send", -1);
end;
Assuming that the attachment
was accepted by the receiving side as shown above, the attachment
list, attachlist is updated with the RC named item to reflect that
the attachment transfer failed.
-
Named item LIBNAME has a value
of "SASUSER."
-
Named item MEMNAME has a value
of "NAMES."
-
Named item TYPE has a value of
"DATASET."
-
Named item RC has a value of 81.
Again, the error code
list maps the return code of 81 into output library is nonexistent.