Sometimes, your first impulse may not be correct, like trading in your practical sedan for a hot 2-seater. Other times, your first impulse is perfect, as in the examples below. Suppose the automobile data you wish to analyze resides in a CSV file. Naturally, your first impulse is to import
Tag: SAS macro
The simple PRINT macro below prints a selected dataset: %macro print(data=&syslast,obs=5); proc print data=&data(obs=&obs); title "%upcase(&data)"; run; %mend print; Suppose you want to print every dataset in the library. Would you enjoy typing a macro call for every dataset in the library? Only if you enjoy coding in the slow
Suppose you have an old jalopy that's perfectly reliable. Your jalopy gets you where you wanna go: no frills; no drama. Do you trade your old wheels in for a racecar that accelerates like crazy and corners like it's on rails? Or stick with what's old and comfortable? Your choice
Your macro just crashed and burned. So, what's the problem? Let’s take a look: The text OR in the code above was misinterpreted as a logical operator. To correct this issue, use the %STR function to protect (disable the normal meaning of) special characters and mnemonics in constant text: The
In my previous blog post, I mentioned that I love the power of the SAS macro language and the power of my yellow Corvette. Now, I want to tell you how to avoid a major pitfall along the “macro programming road.” At the risk of dating myself, you may recall
I love the power of my Corvette and the power of the SAS macro language. That is why, for the past 12 months, when not driving my Corvette, I put my heart and soul into the challenging task of updating our SAS Macro Language 2 course, soliciting input from my
Hi! My name is Jim. I’m a SAS instructor based in Irvine, CA. I spend a lot of time each year teaching students in CA and across the United States how to program in SAS and how to master the SAS macro facility. In case you haven’t taken one of our SAS
Dear Miss SAS Answers, I run a lot of programs that call other programs with %include. I was wondering if there was a way, perhaps through a SAS Automatic Macro variable, to determine 1) whether a program was called or "included" from another program? And if so, what is the