Set Literal Expression

/ members /

The set literal expression provides compact specification of simple set values. It is equivalent in function to the set constructor expression but minimizes typing for sets that contain numeric and string constant values. The set members are specified by members, which are literal values. As with the set constructor expression, each member must have the same type.

The following statement specifies a simple numeric set:

   /1 2.5 4/

The set contains the members 1, 2.5, and 4. A string set could be specified as follows:

   /Miami 'San Francisco' Seattle 'Washington, D.C.'/

This set contains the strings ’Miami’, ’San Francisco’, ’Seattle’, and ’Washington, D.C.’. You can specify string values in set literals without quotation marks when the text follows the rules for a SAS name. Strings that begin with a digit or contain blanks or other special characters must be specified with quotation marks.

Specify tuple members of a set by enclosing the tuple elements within angle brackets (<elements>). The tuple elements can be specified with numeric and string literals. The following example includes the tuple elements <’New York’, 4.5> and <’Chicago’, -5.7>:

   /<'New York' 4.5> <Chicago -5.7>/