RETRIEVE_DATASET

This CALL routine retrieves a data set entry from a package

Syntax

CALL RETRIEVE_DATASET(entryId, libname, memname, rc
<, properties, propValue1, ...propValueN> );

Required Arguments

entryId
identifies the data set entry.
Type:Numeric, Input
libname
specifies the SAS library that will contain the retrieved data set.
Type:Character, Input
memname
names the retrieved data set.
Type:Character, Input
rc
receives a return code.
Type:Numeric, Output

Optional Arguments

properties
identifies a comma-separated list of optional property names. Valid property names are as follows:
  • DATASET_OPTIONS
  • CSV_SEPARATOR
  • CSV_FLAG
Type:Character, Input
propValue1, …propValueN
specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter. Valid property values are defined as follows:
DATASET_OPTIONS character parameter SAS data set options that are to be applied to the retrieved data set. For a complete list of data set options, see the SAS Data Set Options topic in the SAS Help.
CSV_SEPARATOR character property that applies only when the RETRIEVE_DATASET CALL routine is called on a CSV file entry. When this occurs, the CSV file is transformed into a SAS data set. A binary CSV file is identified by a MIME type of application/x-comma-separated-values. Use the CSV_SEPARATOR property to indicate the separator to be used when creating the CSV file. The default separator is a comma. If the CSV file was created at publish time by transforming a SAS data set into a CSV file, then the separator used to create the CSV file will always take precedence. If the CSV file was not created at publish time, then the CSV_SEPARATOR property can be used to specify the separator value used. If the CSV file was not created at publish time and no separator property is specified, then the separator is specified as a comma, by default.
CSV_FLAG character property that only applies when calling the RETRIEVE_DATASET CALL routine for a binary file entry. A binary CSV file is identified by a MIME type of application/x-comma-separated-values. This property is a CSV override flag. By default when converting this binary CSV file into a SAS data set, the first line will be processed as variable names. The second line will be processed as variable label names. All remaining lines will be processed as data. To override this default behavior, the CSV_FLAG value must be NO_VARIABLES or NO_LABELS. To specify both values, specify two CSV_FLAG properties, one with a value of NO_VARIABLES, the other with a value of NO_LABELS. By default, when a CSV file is converted into a data set, the variable lengths are determined by the first row of data. If subsequent rows have greater lengths, then the variable data is truncated. To override this default behavior, specify the CSV_FLAG with a property of NO_TRUNCATION. When this flag value is specified, truncation will not occur, but multiple passes of the data might be necessary in order to perform the resizing.
Type:Character, Input

Details

If the MEMNAME parameter is blank, then the RETRIEVE_DATASET CALL routine creates the data set using the original member name as it was defined at publish time.

Examples

Example 1: Using RETRIEVE_DATASET

The following example retrieves the data set WORK.OUTDATA entry from the package.
lib = 'work';
mem = 'outdata';
CALL RETRIEVE_DATASET(rid, lib, mem, rc);

Example 2: Using RETRIEVE_DATASET with CSV_FLAG Properties

The following example specifies two CSV_FLAG properties.
prop='CSV_SEPARATOR,CSV_FLAG,CSV_FLAG';
separator='/';
flag1 = 'NO_VARIABLES';
flag2 = 'NO_LABELS';
CALL RETRIEVE_DATASET(entryId, libname, memname,
   rc, prop, separator, flag1, flag2);