Animate snowfall in SAS

4
Animated image of falling Koch snowflakes
Out of the bosom of the Air,
    Out of the cloud-folds of her garments shaken,
Over the woodlands brown and bare,
    Over the harvest-fields forsaken,
        Silent, and soft, and slow
        Descends the snow.

"Snow-flakes" by Henry Wadsworth Longfellow

Happy holidays to all my readers! In my last post I showed how to create a well-known fractal called the Koch snowflake. The snowflake is aptly named because it has six-fold symmetry. But as Longfellow noted, a real snowflake is not stationary, but descends "silent, and soft, and slow."

As a gift to my readers, I decided to create an animated greeting card entirely in SAS. The animated GIF (click to enlarge) uses some of the SAS techniques that I have blogged about in 2016. The falling and rotating snowflakes were created by using matrix computations in the SAS/IML language. The animated GIF was created by using ODS graphics and PROC SGPLOT.

Create an animated greeting card with #SAS Click To Tweet

Techniques used to create the animation

If you want to learn how I created this animated GIF with SAS, read on. I've blogged about all the essential techniques in previous posts:

You can download the SAS program that creates the greeting card. Let me know if you adapt this program to create other animated images.

If you like SAS statistical programming or want to learn more about it, subscribe to this blog. In most articles I show how to use SAS for serious pursuits like statistical modeling, data analysis, optimization, and more. But programming with SAS can also be fun, and sometimes it takes a less-serious application to make people say, "Wow! That's cool! I didn't know SAS could do that!"

Share

About Author

Rick Wicklin

Distinguished Researcher in Computational Statistics

Rick Wicklin, PhD, is a distinguished researcher in computational statistics at SAS and is a principal developer of SAS/IML software. His areas of expertise include computational statistics, simulation, statistical graphics, and modern methods in statistical data analysis. Rick is author of the books Statistical Programming with SAS/IML Software and Simulating Data with SAS.

4 Comments

  1. The snowflakes are very nice, thank you for posting the code. The verse of Longfellow seems to have fractal properties too, as it is a quote within a quote! The first line is a reference to the famous balcony scene in Shakespeare's Romeo and Juliet. Best wishes for the Holidays Rick.

    • Rick Wicklin

      "Code is not working" is not useful information. Most likely cause: you don't have SAS/IML or you don't have a recent version of SAS.
      If you want to pursue this, please post the log and your SAS version to the SAS Support Communities: https://communities.sas.com/
      There is no such thing as "SAS 9.0.4", so also post the result of
      %put &SYSVLONG;
      to that site when you ask your question.

Leave A Reply

Back to Top