BookmarkSubscribeRSS Feed
HDSimo
Calcite | Level 5
Hi,
I have some doubts about tables & views.
If i have to create some DS in order to manipulate data and then generate a final dataset, which kind of intermediate file is better to use, view or table? I know that views are smaller, what about the difference in the elaboration time?

Thank you

Simone
5 REPLIES 5
Reeza
Super User
My opinion only...
I use views for reports/datasets where a dataset will be updated and I want this other data set to be updated to reflect this.

A view is a step that is run every time it is accessed, rather than just reading a table. The speed depends on the calculations in the view.

I also have to balance the length of time the view takes to load and how often it is used. For example if a view takes 2 seconds to run but is run 100 times a day, I'd rather have a table updated. On the other hand if it takes 30sec to run, but is run ten times a month, perhaps a view is fine.

Another consideration to use a view over a dataset is storage space, but this only becomes an issue if you continue to use a lot of views, then you can 're-use' space. You still need the space to complete the task in the view.

Not sure I answered your question but hope it helps.
Doc_Duke
Rhodochrosite | Level 12
It's similar to the tradeoffs of datasets and views described in the base language reference (Chapter 29). It is basically a three-way balance between timeliness (view changes with underlying data), disk space (view smaller), and processing time (view generally slower). A view into a relational database may also be considered more secure as the DBA can apply some rules that might not be available in the file system for a table.


Message was edited by: Doc@Duke
Ksharp
Super User
Hi.
Table contains real substantive data,But View only contains information about how you can find data (such as some sql code). So its size will be smaller.



Ksharp
ab_UoN
Calcite | Level 5

Hi,

Is there a simple way to see the definition of the view.  I have a view of a table and am trying to confirm the physical and metadta location of the table that feeds the view.

LinusH
Tourmaline | Level 20

For SQL views:

describe view libname.viewname;

For data step views, use the describe statement.

For details, see online doc,

/Linus

Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 10918 views
  • 0 likes
  • 6 in conversation