Wednesday, October 18, 2006

Using SAS DATA Step Views to Conserve Data Storage Space

A SAS data view is a type of SAS data set that retrieves data values from other files. A SAS data view only contains descriptor information such as the data types and lengths of the variables, plus information that is required for retrieving data values from other SAS data sets or from files that are stored in other software vendors' file formats.

SAS data views are of member type VIEW.

In most cases, you can use a SAS data view as though it were a SAS data file. Example 1 shows how to create a view:

Example 1:

data sasuser.at_risk / view=sasuser.at_risk;
set work.students;
where at_risk = '1';
run;

The VIEW= option tells SAS to compile (but not execute) the source program and to store the compiled code in the input DATA step view.

You can use a DESCRIBE statement in a DATA step to write a copy of the source code for a data set view to the SAS log:

Example 2:
data view=sasuser.at_risk;
describe;
run;

The log from this data step will show the source code used to create the view.

SAS Data View Benefits
You can save disk space by storing a view definition, which stores only the instructions for where to find the data and how it is formatted, not the actual data.

Views can ensure that the input data sets are always current because data is derived from views at execution time.

Since views can select data from many sources, once a view is created, it can provide prepackaged information without the need for additional programming.

Views can reduce the impact of data design changes on users. For example, you can change a query that is stored in a view without changing the characteristics of the view's result.
With SAS/CONNECT software, a view can join SAS data sets that reside on different host computers, presenting you with an integrated view of distributed data.
You can use views as input to other DATA steps or PROC steps and in combination with other data sources using PROC SQL.

When to Use SAS Data Views
Consider the following in order to determine whether a SAS data file or a SAS data view is better for your purposes:
Data files use additional disk space; data views use additional processing time.
Data file variables can be sorted and indexed prior to use; data views must process data in its existing form during execution.

To learn more about creating and using data views, click here.

10 Comments:

At 4:10 AM, Anonymous Anonymous said...

Thanks very much for showing how to describe the definition of a SAS view - most helpful.

 
At 10:01 AM, Anonymous Anonymous said...

really helpful ..thanks....!

 
At 12:10 AM, Blogger Melisa said...

Thanks for sharing this valuable post to my knowledge great pleasure to be here SAS has great scope in IT industry. It’s an application suite that can change, manage & retrieve data from the variety of origin & perform statistical analytic on it
Regards,
sas training in Chennai

 
At 3:01 AM, Blogger Unknown said...


The information you have given here is truly helpful to me. CCNA- It’s a certification program based on routing & switching for starting level network engineers that helps improve your investment in knowledge of networking & increase the value of employer’s network
Regards,
ccna training in Chennai|ccna training chennai|ccna training institutes in Chennai

 
At 10:31 PM, Blogger Unknown said...


Hi
Quite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming blog to enhance my skill set, keep blogging.
Regards,
Informatica training in chennai|Best Informatica Training In Chennai|sas training in Chennai

 
At 4:44 AM, Blogger Unknown said...


Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
Regards,
SAP training in chennai|SAP Course in Chennai|sap training in Chennai

 
At 5:01 AM, Blogger Unknown said...


Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
Regards,

cognos Training in Chennai|cognos Training Chennai|cognos Training

 
At 2:14 AM, Blogger deeksha said...

I got more information about the sas and i need more information which is useful and informative thanks for sharing this information.




informatica training in chennai

 
At 2:14 AM, Blogger kanchana said...

Your blog is awesome..You have clearly explained about it ...Its very useful for me to know about new things..Keep on blogging..
CCNA training in chennai

 
At 6:59 AM, Blogger Unknown said...

When the DATA step views are referenced in the SET statements of the subsequent DATA step executions, DEPARTMENT records are read from the CA-IDMS database and selected record data values are placed in two SAS data sets.


Base SAS training in Chennai

Datawarehousing training in Chennai

Informatica training in Chennai

Hadoop training in Chennai

MSBI training in Chennai

 

Post a Comment

<< Home