My name is Yufeng Guo. I'm the author of the book, Beginning SAS Programming.
Years ago when I was first learning SAS, I followed most people's recommendation and bought two popular books from Amazon, the Little SAS Book by Lora Delwiche and Susan Slaughter and Learning SAS by Example: A Programmer's Guide by Ron Cody. After these two books arrived, I was so excited about learning SAS. However, a week later, my enthusiasm turned into frustration. Neither book taught me how to write a simple Hello World program. I turned page after page desperately trying to find some instructions on how to write a Hello World program, but I just couldn’t find it. I thought this couldn’t be true. They are two great beginner books. They must have detailed instructions on how to write my first SAS program. I searched these books the second time, the third time, and the fourth time. Again, again, and again, I just couldn’t figure out what to do after I launched my PC SAS program from All Programs. Several weeks passed and I was still unable to write a simple SAS program. My interest in learning SAS was gone. I returned the two books to Amazon and decided not to learn SAS after all. There were plenty of things for me to do. Why waste my time learning SAS?
Many months passed. I didn’t learn anything about SAS. Yes, in my corporate job, I needed to modify some legacy SAS code. But I could do that with almost no understanding of SAS.
However, eventually I had to gain deeper knowledge of SAS programming because I needed to write SAS programs from scratch to fetch large tables each with over 10 million rows. Though I finally figured out SAS, it was a painful learning experience. I would have learned SAS so much faster were there a true beginner’s book for SAS.
And I was a lucky one who has figured how SAS works. Some of the people I know started learning SAS at the same time when I started. We were at the same starting line. Years passed and they are still at the beginner level, unable to tackle complex problems.
If you were a true novice and learned how to program in SAS using Little SAS Book or Learn SAS By Example, congratulations! But neither book could help me learn SAS. This is why I wrote this book.
The Little SAS Book and Learn SAS By Example are (great) reference books, not tutorials for complete beginners.
Unfortunately, there aren’t many true beginner SAS books. If you don’t like mine, try SAS Essentials: A Guide to Mastering SAS for Research by Alan C. Elliott.
If you are a true beginner, don’t start from the SAS DATA Step. Instead, learn SAS PROC SQL first. This is explained in the preface of my book, but I want to emphasize it again. SAS DATA step programming is a shortcut to SQL. You won’t appreciate the power of DATA step programming until you have some rudimentary knowledge of SQL. You wouldn't want to skip addition and jump straight to multiplication. Similarly, you wouldn't want to skip SQL and dive directly to DATA step.
Learning SQL first helps you set your path straight at the very beginning. For example, you immediately know that SAS is a database programming language, not another procedural language like C.
If you know C or Java, when you need to calculate the sum of some values, you write a loop. While this is great for a procedural language, looping through each row to find the sum is typically a bad idea in a database programming. I'm not going to explain why because many already explained it. Read this article and you'll understand why. Knowing that SAS is a database programming language helps you avoid a common tendency to perform a full table scan to calculate the sum.