Tag: macro

Programming Tips
Ron Cody 0
Two macros for detecting data errors

Last year, I wrote a blog demonstrating how to use the %Auto_Outliers macro to automatically identify possible data errors. This blog demonstrates a different approach—one that is useful for variables for which you can identify reasonable ranges of values for each variable. For example, you would not expect resting heart

Programming Tips
Leonid Batkhan 0
Dividing by zero with SAS

Whether you are a strong believer in the power of dividing by zero, agnostic, undecided, a supporter, denier or anything in between and beyond, this blog post will bring all to a common denominator. History of injustice For how many years have you been told that you cannot divide by

Learn SAS | Programming Tips
Jim Simon 0
How to format a macro variable

Would you like to format your macro variables? Easy!  Just use the %FORMAT function, like this: What?! You never heard of the %FORMAT function? Of course not, cuz it doesn't exist! No problem. Just create it, like this: %macro format(value,format); %if %datatyp(&value)=CHAR %then %sysfunc(putc(&value,&format)); %else %left(%qsysfunc(putn(&value,&format))); %mend format; The %FORMAT

Marty Hultgren 0
Quote confusion: How do quotes and macro work together?

The English language, a mishmash of words from many tongues and with rules that aren’t always consistent, sometimes causes people to stumble when writing quotes. There are numerous humorous websites with examples of incorrectly-used quotes on signs saying things like “Sandwiches Prepared ‘Fresh’,” or “Help ‘Wanted’ – Please ‘inquire’ within”.

Programming Tips
Russ Tyndall 0
Macro quoting made easy

Are there times when you need to pass special characters to a macro variable but cannot find the right technique to accomplish the task?  In this article I’ll discuss the different macro quoting functions and give a simple technique to help you determine which macro quoting function to use. Why

Learn SAS
Shelly Goodin 0
SAS author's tip: Why think %locally?

This week's SAS tip is from Robert Virgile and his illuminating new book SAS Macro Language Magic: Discovering Advanced Techniques. Robert has 30 years of experience developing and teaching SAS classes. And his new book is filled with powerful programming techniques. If you like this week's free excerpt, you can read

Learn SAS
Shelly Goodin 0
SAS author's tip: %NLINMIX macro tips

This week's %NLINMIX macro tips come from the esteemed authors of SAS for Mixed Models, Second Edition. Ramon C. Littell, George A. Milliken, Walter W. Stroup, Russell D. Wolfinger, and Oliver Schabenberger combined their expertise to write this indispensable guide. This 800 page book has made a big impact in the user community

1 2