BookmarkSubscribeRSS Feed
AndersS
Pyrite | Level 9

Hi! Some years ago I read a very good book about efficient coding. In summary:   Solve the correct problem, make sure that your code is as clear and easy to understand as possible. If you have time spend it on documenting the problem and the solution. - When all this has been done - then you can start to experiment with writing the code, so that it runs faster.
(The book was written in 1966 I think. Efficient Fortran techniques. CPU and IO were VERY expensive at that time).

Anders Sköllermo (Skollermo in English)
Peter_C
Rhodochrosite | Level 12

I/O can be expensive still, in run-time

For that reason, I often create data step views rather than intermediate tables. (but only when the view would be read just once or twice)

The advantage views provide is a major reduction in I/O.

The intermediate data is being created as it is read.

To achieve this, often sort+merge processes are replaced with format/array/hash look-ups.

AndersS
Pyrite | Level 9

Hi Peter! I DO agree about Data Step view. I have used them several times, which resulted in great reductions in computer resources needed.

Anders Sköllermo (Skollermo in English)
Patrick
Opal | Level 21

Views can be very helpful. I've made the experience though that when "nesting" too many SAS SQL views it can have a negative impact on performance. "The theory" is that this is due to the SQL optimizer no more properly optimizing the SQL.

Peter_C
Rhodochrosite | Level 12

It's probably inevitable that the optimizers have a limit to the resources they can use to "layer" the views. Each time I have had to trial with high volume data to ensure production processes will be resilient.

As usual, there are trade-offs between I/O and cpu time.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 19 replies
  • 2000 views
  • 6 likes
  • 12 in conversation