Chapter Contents

Previous

Next
QUEUE_ATTOPT

QUEUE_ATTOPT



Define additional attachment information.


Syntax
QUEUE_ATTOPT Example

Syntax

CALL QUEUE_ATTOPT(queueId, optName, optValue, rc <, desc, idx, minorVersion, majorVersion,
attachVersion
>);

Where... Is type... And represents...
queueId N queue identifier
optName C option name
optValue C value of option
rc N return code
desc C user-specified description
idx C index creation override
minorVersion N user-specified minor version
majorVersion N user-specified major version
attachVersion C attachment version

QUEUE_ATTOPT defines additional options that can be used to subset the attachment data and can also be used to provide useful information to the receiving side. QUEUE_ATTOPT applies to the last attachment that was defined by means of the QUEUE_SETATT function.

The optName parameter must be one of the following:

DATASET_OPTIONS
This option indicates that optValue is a character string that represents any valid data set options. This provides a way to subset the data before the transfer. This option is only valid when the attachment is a data set.

WHERE
This option indicates that optValue is a character string that represents a valid WHERE statement. This provides a way to subset the data before the transfer. This option is only valid when the attachment is a data set.

EXCLUDE
This option indicates that optValue is a character string that represents an EXCLUDE statement to apply to the catalog. This provides a way to exclude specific entries so that unnecessary entries are not transferred. OptValue should take the form of "ENTRY1.ENTRYTYPE ENTRY2.ENTRYTYPE..." for each entry that is to be excluded. The SELECT and EXCLUDE items are mutually exclusive so you can only specify one for a given catalog attachment. This option is only valid when the attachment is a catalog.

SELECT
This option indicates that optValue is a character string that represents a SELECT statement to apply to the catalog. This provides a way to select specific entries that are to be included without sending the entire catalog. OptValue should take the form of ENTRY1.ENTRYTYPE ENTRY2.ENTRYTYPE... for each entry that is to be selected. The SELECT and EXCLUDE items are mutually exclusive, therefore, you can only specify one for a given catalog attachment. This option is only valid when the attachment is a catalog.

If an error occurs, rc is updated and returned as a non-zero value. Use the SYSMSG() function to print the message that is associated with the non-zero rc.

The remaining parameters are optional and positional. Supported optional parameters include:

The desc parameter is user-specified descriptive text to accompany the attachment. This information is surfaced to the user on the receiving side and allows the user to provide specific information about this attachment. This can be specified for any type of attachments.

The idx parameter can have a value of NO or N if the user wants to suppress the transfer of index information. Otherwise, double quotes (" ") may be passed in, to indicate that the default will not be overridden. By default, the data set's index is re-created on the output data set. This parameter allows the default to be overridden so that index creation does not occur. This parameter is specific to data sets and will be ignored by all other attachment types. A value of (" ") may be entered to indicate that it should be ignored.

The minorVersion parameter represents a numeric, user-specified version that can be presented to the receiver.

The majorVersion parameter represents a numeric, user-specified version that can be presented to the receiver.

The attachVersion parameter is only valid in Version 7 or later sessions and only applies to data set and catalog attachments. This parameter allows the user to send the catalog or data set to the queue so that a Version 6 client can read the attachments. If a Version 8 application sends a Version 8 data set or catalog to a queue, a Version 6 application cannot accept that attachment. However, the Version 8 application can specify the value of VERSION_612 for this parameter. This forces the catalog or data set to be sent in Version 6 format so that both Version 6 and Version 8 applications can accept them.


QUEUE_ATTOPT Example

This example defines four attachments to the queue defined by queueId.

   /*************************************/
   /* Attachment one is the data set    */
   /* SASUSER.EMPLOYEE.                 */
   /*************************************/
type1 = "DATASET";
lib1 = "SASUSER";
mem1 = "EMPLOYEE";
call queue_setatt(queueId, rc, type1, 
                  lib1, mem1);

   /*************************************/
   /* Define data set options and       */
   /* indicate indexes should not be    */
   /* created on output data set.       */
   /*************************************/
opt  = "DATASET_OPTIONS";
optval = "KEEP=SMITH";
desc ="";
idx ="NO";
call queue_attopt(queueId, opt, optval, 
                  rc, desc, idx);

   /*************************************/
   /* Attachment two is an external     */
   /* binary file.                      */
   /*************************************/
type2 = "EXTERNAL_BIN";
fspec2 = "FILENAME";
fname2 = "/tmp/binary.file";

call queue_setatt(queueId, rc, type2, 
                  lib2, mem2);

   /*************************************/
   /* no options to define for this     */
   /* attachment                        */
   /*************************************/

   /*************************************/
   /* Attachment three is the catalog   */
   /* SASHELP.CONNECT.                  */
   /*************************************/
type3 = "CATALOG";
lib3 = "SASHELP";
mem3 = "CONNECT";
call queue_setatt(queueId, rc, type3, 
                  lib3, mem3);

   /*************************************/
   /* Specify SELECT statement to subset*/
   /* transfer of connect catalog.      */
   /*************************************/
opt  = "SELECT";
optval = "QUEUE.CLASS STATION.CLASS";
desc = 'Queue and station classes';
idx=""
minor=1;
call queue_attopt(queueId, opt, optval, 
                  rc, desc, idx, minor);

   /*************************************/
   /* Attachment four is the data set   */
   /* SASUSER.SALARY.                   */
   /*************************************/
type4 = "DATASET";
lib4 = "SASUSER";
mem4 = "SALARY";
call queue_setatt(queueId, rc, type4, 
                  lib4, mem4);

   /*************************************/
   /* Define data set options for       */
   /* SASUSER.SALARY.                   */
   /*************************************/
opt  = "DATASET_OPTIONS";
optval = "WHERE=(INCOME>50000) 
          KEEP=(FNAME LNAME INCOME)";
call queue_attopt(queueId, opt, optval, rc);


Chapter Contents

Previous

Next

Top of Page

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