Tag: macro

Learn SAS | Programming Tips
Jim Simon 11
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”.

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 1
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