Chapter Contents |
Previous |
Next |
SAS/CONNECT User's Guide |
The attachlist parameter is an SCL list that contains other SCL lists and must contain a separate list for each attachment to include with the message. The syntax for building the attachment list is the same, whether using direct or indirect (queued) messaging.
The supported attachment types are:
Data Set Attachments |
When data set attachments are transferred, all data set attributes are cloned by default. These include label, type, passwords, encryption, index, and sort order information.
To specify a data set attachment, the following named items are required:
Additionally, there are optional named items that may be specified for data set attachments. These optional settings not only provide a means to subset the data before transfer, but they also provide a way to surface descriptive information to the receiving side. The optional named items that are supported include:
This example specifies two data set attachments to be included with the message. The data sets are SASUSER.DATAX and WORK.ABC.
For data set SASUSER.DATAX, the required named items would be defined as:
For data set WORK.ABC, the required named items would be defined as:
For both data sets, DESCRIPTION was optionally set so that more descriptive information will be surfaced to the receiver.
/***************************************/ /* list1 contains attachment one, */ /* sasuser.datax */ /***************************************/ list1 = makelist(); rc = setnitemc(list1, "DATASET", "TYPE"); rc = setnitemc(list1, "DATAX", "MEMNAME"); rc = setnitemc(list1, "SASUSER", "LIBNAME"); rc = setnitemc(list1, "Tasklist dataset for client application.", "DESCRIPTION"); /***************************************/ /* list2 contains attachment two, */ /* work.abc */ /***************************************/ list2 = makelist(); rc = setnitemc(list2, "ABC", "MEMNAME"); rc = setnitemc(list2, "WORK", "LIBNAME"); rc = setnitemc(list2, "DATASET", "TYPE"); rc = setnitemc(list2, "Playpen data.", "DESCRIPTION"); /***************************************/ /* attachlist is the main attachment */ /* list. It must contain a separate */ /* SCL list for each attachment */ /***************************************/ attachlist = makelist(); attachlist = insertl(attachlist, list1, -1); attachlist = insertl(attachlist, list2, -1); msgtype = 25; hdr = 0; call send(obj, '_sendlist', msgtype, hdr, attachlist, rc, sendlist); /*** or ***/ call send(obj, '_send', msgtype, hdr, attachlist, rc, string1);
This example illustrates the use of WHERE and DATASET_OPTIONS to subset the data before transfer.
/***************************************/ /* list 1 contains attachment one, */ /* sasuser.xx */ /***************************************/ list1 = makelist(); rc = setnitemc(list1, "DATASET", "TYPE"); rc = setnitemc(list1, "XX", "MEMNAME"); rc = setnitemc(list1, "SASUSER", "LIBNAME"); rc = setnitemc(list1, "(X>10) AND (Y < 100)", "WHERE"); rc = setnitemc(list1, "DROP=NAMES READ=X", "DATASET_OPTIONS"); attachlist = makelist(); attachlist = insertl(attachlist, list1, -1); msgtype = 2; hdr = 0; call send(cobs, '_send', msgtype, hdr, attachlist, rc, Numeric1);
Catalog Attachments |
Additionally, there are optional named items that may be specified for catalog attachments. These optional settings provide a way to subset the catalog before transfer and to surface descriptive information to the receiving side. The optional named items that are supported include:
This example specifies one catalog attachment to be included with the message. The catalog is SASHELP.BASE. The required named items are
Optionally, DESCRIPTION is specified to provide descriptive information to the receiving side, and SELECT is specified to select specific entries to include.
/***************************************/ /* main attachment list */ /***************************************/ attachlist = makelist(); /***************************************/ /* build attachment one with the */ /* SELECT statement */ /***************************************/ list1 = makelist(); rc = setnitemc(list1, "CATALOG", "TYPE"); rc = setnitemc(list1, "BASE", "MEMNAME"); rc = setnitemc(list1, "SASHELP", "LIBNAME"); rc = setnitemc(list1, "RLIST.LIST XYZ.SCL MAIN.FRAME", "SELECT"); rc = setnitemc(list1, "A few entries from base catalog.", "DESCRIPTION"); /***************************************/ /* insert attachment one into main list*/ /***************************************/ attachlist = insertl(attachlist, list1, -1); msgtype = 2; hdr = 0; call send(cobs, '_send', msgtype, hdr, attachlist, rc, "string1");
External File Attachments |
Additionally, there are optional named items that may be specified. These optional settings include:
This example defines three external file attachments
to send with the message. The first attachment is an external text file,
/tmp/text.file
. The required
named items for this attachment are
/tmp/text.file
The second attachment is an external text file defined by the fileref RLINK. The required named items for this attachment are
Finally, the last attachment is an external binary
file,
/tmp/binary.file
. The required
named items for this attachment are
/tmp/binary.file
.
The optional named items that may be specified for external file attachments, which are used in this example, include DESCRIPTION and MAJOR_VERSION.
/***************************************/ /* LIST1 contains attachment one */ /***************************************/ list1 = makelist(); rc = setnitemc(list1, "EXTERNAL_TEXT", "TYPE"); rc = setnitemc(list1, "/tmp/text.file", "FILENAME"); rc = setnitemc(list1, "modified script file for unix", "DESCRIPTION"); rc = setnitemc(list1, 11, "MAJOR_VERSION"); /***************************************/ /* LIST2 contains attachment two */ /***************************************/ list2 = makelist(); rc = setnitemc(list2, "EXTERNAL_TEXT", "TYPE"); rc = setnitemc(list2, "RLINK", "FILEREF"); /***************************************/ /* LIST3 contains attachment three */ /***************************************/ list3 = makelist(); rc = setnitemc(list3, "EXTERNAL_BIN", "TYPE"); rc = setnitemc(list3, "/tmp/binary.file", "FILENAME"); /***************************************/ /* ATTACHLIST is the main attachment */ /* list; insert each attachment into */ /* main attachment list. */ /***************************************/ attachlist = makelist(); attachlist = insertl(attachlist, list1, -1); attachlist = insertl(attachlist, list2, -1); attachlist = insertl(attachlist, list3, -1); msgtype = 22; hdr = 0; call send(cobs, '_send', msgtype, hdr, attachlist, rc, string1);
Utility Attachments |
To specify a utility file attachment, the following named items are required:
Additionally, there are optional named items that may be specified for utility file attachments. These optional settings provide a way to surface descriptive information to the receiving side. The optional named items that are supported include:
This example specifies two utility file attachments and one data set to be included with the message. The files are SASUSER.TESTDATA (a SAS data set), WORK.FMDDB (an MDDB file), and SASUSER.TESTVIEW (an SQL View).
The required named items for the data set SASUSER.TESTDATA are
The required named items for the data set WORK.FMDDB are
The required named items for the data set SASUSER.TESTVIEW are
For the three data sets, DESCRIPTION was optionally set so that more descriptive information will be surfaced to the receiver.
list1 = makelist(); rc = setnitemc(list1, "DATASET", "TYPE"); rc = setnitemc(list1, "TESTDATA","MEMNAME"); rc = setnitemc(list1, "SASUSER", "LIBNAME"); rc = setnitemc(list1, "Testdata in sasuser directory.", "DESCRIPTION"); list2 = makelist(); rc = setnitemc(list2, "FMDDB", "MEMNAME"); rc = setnitemc(list2, "WORK", "LIBNAME"); rc = setnitemc(list2, "MDDB", "TYPE"); rc = setnitemc(list2, "Playpen mddb", "DESCRIPTION"); list3 = makelist(); rc = setnitemc(list3, "TESTVIEW","MEMNAME"); rc = setnitemc(list3, "SASUSER", "LIBNAME"); rc = setnitemc(list3, "VIEW", "TYPE"); rc = setnitemc(list3, "SQL view file", "DESCRIPTION"); /***************************************/ /* ATTACHLIST is the main attachment */ /* list. It must contain a separate */ /* SCL list for each attachment */ /***************************************/ attachlist = makelist(); attachlist = insertl(attachlist, list1, -1); attachlist = insertl(attachlist, list2, -1); attachlist = insertl(attachlist, list3, -1); msgtype = 25; hdr = 0; call send(obj, '_sendlist', msgtype, hdr, attachlist rc, sendlist); /*** or ***/ call send(obj, '_send', msgtype, hdr, attachlist rc, string1);
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.