Tag: SAS macro

Learn SAS
Jim Simon 7
Importing CSV files into SAS datasets

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

Jim Simon 0
Coding in the fast lane with data-driven macro calls

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

Learn SAS
Jim Simon 9
Time to trade in your jalopy macro?

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

Jim Simon 0
Don’t let your macros crash and burn

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

Jim Simon 2
The SAS Macro Language: Powerful as a Corvette!

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

Miss SAS Answers 2
Tracing calling programs for %INCLUDE

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