In the following example,
PROC SQL connects to the SQL Pass-Through facility for OLAP to create
a new data set named temp, which contains all the variables that are
returned from the multidimensional expression (MDX) defined in the
SELECT query. The OLAP server returns query results in a tabular format
known as a flattened rowset. The table rows become the observations
of the output data set, and the table columns become the variables.
After all the rows are returned, PROC SQL closes the query. The server
connection is terminated when the program encounters a DISCONNECT
statement or when the PROC SQL step ends.
Note: Because the OLAP server does
not impose the same restrictions on column names, types, and lengths
that SAS imposes on data sets, some conversion might be required.
100 proc sql;
101 connect to olap (host=localhost service=olap1);
102 create table temp as select * from connection to olap
103 (
104 select { dealers.dealer.members } on 0,
105 { [cars].[Car].members,
106 [cars].[Color].members } on 1
107 from mddbcars
108 );
109 disconnect from olap;
110 quit;