Publish Package Interface |
Inserts a SAS data set into a package.
CALL INSERT_DATASET(packageId, libname, memname, desc, nameValue, rc <, properties, propValue1, ...propValueN> );
Name/value pairs are site-specific; they are used for the purpose of filtering.
properties
parameter. Valid
property values are defined as follows:
The ALLOW_READ_PROTECTED_MEMBER property must be asserted on read-protected data sets in order to be published. This ensures that the publisher realizes that this is a read-protected data set, and that the read password and encryption attributes will not be preserved when stored in the intermediate format. If this property is not applied, the publish operation will fail when trying to publish the read-protected data set.
By default, when writing numeric variable values into the CSV file, BEST is used to format numerics that have no format associated with them. To override this default, specify the property value EXTENDED on the CSV_FLAG property. This will extend the number of digits used as the precision level.
By default, if the data set is transformed into a CSV file, the file's first line will contain all of the specified variables. The second line will contain all of the specified labels. To override this default behavior, specify flags with values "NO_VARIABLES" or "NO_LABELS". To specify both values, a CSV_FLAG property must be specified for each.
When the data set is published, data set attributes are cloned so that when it is retrieved back into SAS, the created data set will have similar attributes. Attributes that are cloned include encryption, passwords, data set label, data set type, indexes and integrity contraints. It is important to know that the password and encryption attributes are not preserved in the intermediate format (whether on a queue or in an archive). Because of this exposure, take care when publishing data sets that are password-protected and/or encrypted.
The following example specifies a transformation type of CSV and two CSV_FLAG properties. The data set will be transformed into a CSV file and published in CSV format.
prop='TRANSFORMATION_TYPE,CSV_SEPARATOR,CSV_FLAG,CSV_FLAG'; ttype='CSV'; separator='/'; flag1 = 'NO_VARIABLES'; flag2 = 'NO_LABELS'; CALL INSERT_DATASET(packageId, libname, memname, desc, nameValue, rc, prop, ttype, separator, flag1, flag2);
The following example inserts the SAS data set FINANCE.PAYROLL into a package.
libname = 'finance'; memname = 'payroll'; desc = 'Monthly payroll data.'; nameValue=''; CALL INSERT_DATASET(packageId, libname, memname, desc, nameValue, rc);
The following example uses the DATASET_OPTIONS property to apply a password for read access and to apply a subsetting WHERE statement to the data set when publishing the package. Because the data set is read-protected, you must specify the ALLOW_READ_PROTECTED_MEMBER property. Package publishing fails without this property.
libname = 'hr'; memname ='employee'; desc = 'Employee database.'; nameValue=''; properties="DATASET_OPTIONS, ALLOW_READ_PROTECTED_MEMBER"; opt="READ=abc Where=(x<10)"; allow="yes"; CALL INSERT_DATASET(packageId, libname, memname, desc, nameValue, rc, properties, opt, allow);
The following example uses the TRANSFORMATION_TYPE property to publish a data set in CSV format.
libname = 'hr'; memname = 'employee'; desc = 'Employee database.'; nameValue=''; ttype ='CSV'; prop = "TRANSFORMATION_TYPE"; CALL INSERT_DATASET(packageId, libname, memname, desc, nameValue, rc, prop, ttype);
Publish Package Interface |