difference between SAS view and SAS Compiled Program?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 161
Accepted Solution

difference between SAS view and SAS Compiled Program?

Could someone tell me what is the major difference between the two?  If I hope to make my program run faster, which would be a better way to go?  What factors should I consider in choosing between these two? 

Thanks !


Accepted Solutions
Solution
‎01-29-2014 03:10 AM
Super User
Posts: 5,426

Re: difference between SAS view and SAS Compiled Program?

Posted in reply to caveman529

A SAS view (data step or SQL) is a program that is being executed when it's called. This is typical not beneficial from a performance point of view, but it addresses a lot of other issues, such as security, hide business logic, ease of access etc.

Compiled program can also be used for hide programming logic, In the early days of computing when CPU cycles were expensive, this could also be a way of trimming the efficiency of an application. In these days with large data sets, advanced analysis etc, I/O tend to be the bottleneck, and perhaps execution time - not time spent on compiling.

So, don't chose pre compiled data steps for performance reasons (unless your situation is very rare).

Views can be considered when the amount of resources to create redundant data (opposed to using a view) is higher than the overhead of accessing the view.

Data never sleeps

View solution in original post


All Replies
Solution
‎01-29-2014 03:10 AM
Super User
Posts: 5,426

Re: difference between SAS view and SAS Compiled Program?

Posted in reply to caveman529

A SAS view (data step or SQL) is a program that is being executed when it's called. This is typical not beneficial from a performance point of view, but it addresses a lot of other issues, such as security, hide business logic, ease of access etc.

Compiled program can also be used for hide programming logic, In the early days of computing when CPU cycles were expensive, this could also be a way of trimming the efficiency of an application. In these days with large data sets, advanced analysis etc, I/O tend to be the bottleneck, and perhaps execution time - not time spent on compiling.

So, don't chose pre compiled data steps for performance reasons (unless your situation is very rare).

Views can be considered when the amount of resources to create redundant data (opposed to using a view) is higher than the overhead of accessing the view.

Data never sleeps
Valued Guide
Posts: 2,177

Re: difference between SAS view and SAS Compiled Program?

in addition to guidance recognise that a VIEW reads it's input sources every time it runs. So VIEW is great where it is used as often or less often than the source data changes. However, if your view reduces the data to fewer columns and fewer rows (for efficiency) these reductions would occur each time the view is used. That repeated "reduction" process re-reading all the rows of the source, might eliminate the I/O savings the view implies over an intermediate permanent dataset.

So I think the choice to use a view involves understanding how it is used and how often.

Another consideration about VIEWs.

When the information needed to subset the rows of the source only become available when the view is read (rather than compiled) you might expect to read the view with a WHERE. If that is your situation rather than build a data step view, try to create and use an SQL view instead, because that has a better chance of optimising the read and joins of the underlying source data tables when the view runs.

Of course there are many other issues that might demand a data step over sql and vice versa. With no such restriction I would reccommend using an SQL view in preference to DATA step view (imho)

Regular Contributor
Posts: 161

Re: difference between SAS view and SAS Compiled Program?

Thanks, guys! 

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 302 views
  • 4 likes
  • 3 in conversation