Tag: SAS programmer

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.

How to perform an operation on all numeric or all character variables in a SAS data set

In a previous blog, I demonstrated a program and macro that could identify all numeric variables set to a specific value, such as 999. This blog discusses an immensely useful technique that allows you to perform an operation on all numeric or all chara…

Keeping your data set clean: Integrity constraints

When I teach my Data Cleaning course, the last topic I cover in the two-day course is SAS Integrity Constraints.  I find that most of the students, who are usually quite advanced programmers, have never heard of Integrity Constraints (abbreviated ICs).  I decided a short discussion on this topic would […]

The post Keeping your data set clean: Integrity constraints appeared first on SAS Learning Post.

The Little SAS Program’s Big Night Out

The little SAS program’s official name was Extract_Transform_Load_ 0314.sas.  But, that name was much too formal, way too long, and did not roll off of the tongue very easily at all.  So, everybody simply called her:  ETL Pi. ETL Pi was conceived in a 2-hour project strategy meeting in conference […]

The post The Little SAS Program’s Big Night Out appeared first on SAS Learning Post.

Determining the size of a SAS data set

When developing SAS® data sets, program code and/or applications, efficiency is not always given the attention it deserves, particularly in the early phases of development. Since data sizes and system performance can affect a program and/or an application’s behavior, SAS users may want to access information about a data set’s […]

The post Determining the size of a SAS data set appeared first on SAS Learning Post.

What’s your SAS interface?

I recently asked a SAS user, “Which interface do you use for SAS?” She replied, “Interface? I just install SAS and use it.” “You’re using the SAS windowing environment,” I explained, but she had no idea what I was talking about. This person is an extremely sophisticated SAS user who […]

The post What’s your SAS interface? appeared first on SAS Learning Post.

The Other 27 SAS Numeric Missing Values

What?!?  You mean a period (.) isn’t the only SAS numeric missing value? Well, there are 27 others: .A .B, to .Z and ._ (period underscore). Your first question might be: “Why would you need more than one missing value?”  One situation where multiple missing values are useful involves survey data. Suppose […]

The post The Other 27 SAS Numeric Missing Values appeared first on SAS Learning Post.