I'm trying to create a view from SAS to SQL (i.e. I want to be able to query this view in SQL).
Let's say I have a bunch of tables called TABLE1, TABLE2, TABLE3....TABLE10.
I want a view that runs the following code:
select * from TABLE1
UNION
select * from TABLE2
UNION
select * from TABLE3
UNION......
So I want to create a view that runs the code to create a union of all tables. In SAS I created a macro variable that literally has all of that code. However when I run the following:
proc sql noprint;
create view SQL.TABLE_VIEW as &MACRO_VAR; quit;
I just get an error saying it cannot be processed directly by the database. Just curious if anyone knows how to solve this?
Let's say I have a bunch of tables called TABLE1, TABLE2, TABLE3....TABLE10.
I want a view that runs the following code:
select * from TABLE1
UNION
select * from TABLE2
UNION
select * from TABLE3
UNION......
So I want to create a view that runs the code to create a union of all tables. In SAS I created a macro variable that literally has all of that code. However when I run the following:
proc sql noprint;
create view SQL.TABLE_VIEW as &MACRO_VAR; quit;
I just get an error saying it cannot be processed directly by the database. Just curious if anyone knows how to solve this?