www.sas.com > SAS UK > In the Know Homepage Search | Contact Us    
SAS UK Newsletter Banner SAS - The power to know(tm)  

How can I find out the code used to define my view?

Forgotten the definitions of your views? Use the following syntax to find out how they are defined.

Here's an example using the procedure SQL.

proc sql;
describe view saslibrary.viewname;
quit;

When using the SAS Datastep to create the view, you can also use the following syntax within a datastep to see the syntax used to create that view.

data sasuser.testview / view=sasuser.testview;
   set sashelp.oranges;
   Avg_Price=sum(of price1-price2) / 2;
run;

data view=sasuser.testview;
describe;
run;

Note: The above code has been tested using SAS 8.2 on the Windows operating system.