Tag: macro

Zebra Puzzle Terminator: A general automatic reasoning system solving method

By starting from a set of purely declarative statements, any zebra puzzle with limited constraints can be tagged and solved quickly in the same way without changing any code.

Zebra Puzzle Terminator: A general automatic reasoning system solving method was published on SAS Users.

How to use the SAS Auto Call facility

Many SAS programmers use macros. I have seen students in my SAS classes use several methods to activate their macros. One way is to load the macro in the Display manager or editor in SAS OnDemand for Academics and submit it. Another technique is to use the statement %Include macro-name. […]

How to use the SAS Auto Call facility was published on SAS Users.

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 […]

Two macros for detecting data errors was published on SAS Users.

Adjusting outliers with the 1.5 IQR rule

In my new book, End-to-End Data Science with SAS: A Hands-On Programming Guide, I use the 1.5 IQR rule to adjust multiple variables.  This program utilizes a macro that loops through a list of variables to make the necessary adjustments and creates an output data set. One of the most […]

Adjusting outliers with the 1.5 IQR rule was published on SAS Users.

Finding Possible Data Errors Using the %Auto_Outliers Macro

One of the first and most important steps in analyzing data, whether for descriptive or inferential statistical tasks, is to check for possible errors in your data. In my book, Cody’s Data Cleaning Techniques Using SAS, Third Edition, I describe a macro called %Auto_Outliers. This macro allows you to search […]

Finding Possible Data Errors Using the %Auto_Outliers Macro was published on SAS Users.

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 […]

Dividing by zero with SAS was published on SAS Users.

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 […]

The post How to format a macro variable appeared first on SAS Learning Post.