Posts Tagged ‘ SAS programmer ’

Simple Proc Print trick for grouped data

November 10, 2017
By

Here's a Proc Print trick for grouped data. Suppose your data is divided into groups, such as males and females. You could sort by the grouping variable before printing, like this: Suppose you want to better emphasize the groups. You could add a BY sta...
Read more »

Tags: , , ,
Posted in SAS | Comments Off on Simple Proc Print trick for grouped data

Finding your Dream Car with a little macro magic

October 25, 2017
By

Suppose you want a list of car manufacturers from the CARS dataset. Easy!  Call the %CHARLIST macro from a %PUT statement, like this: The CHARLIST macro generates a list of unique values of a selected variable from a selected dataset. So does PROC FREQ. But, if you don't need statistics, the CHARLIST

The post Read more »

Tags: , , , ,
Posted in SAS | Comments Off on Finding your Dream Car with a little macro magic

How to format a macro variable

October 16, 2017
By

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 Read more »

Tags: , , , , ,
Posted in SAS | Comments Off on How to format a macro variable

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

June 27, 2017
By

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...
Read more »

Tags: , , , ,
Posted in SAS | Comments Off on How to perform an operation on all numeric or all character variables in a SAS data set

Keeping your data set clean: Integrity constraints

June 26, 2017
By

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 Read more »

Tags: , , , ,
Posted in SAS | Comments Off on Keeping your data set clean: Integrity constraints

The Little SAS Program’s Big Night Out

May 15, 2017
By

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 Read more »

Tags: , , ,
Posted in SAS | Comments Off on The Little SAS Program’s Big Night Out

Determining the size of a SAS data set

April 25, 2017
By

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 Read more »

Tags: , , , ,
Posted in SAS | Comments Off on Determining the size of a SAS data set

What’s your SAS interface?

April 12, 2017
By

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 Read more »

Tags: , , , ,
Posted in SAS | Comments Off on What’s your SAS interface?

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

Sponsors







Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.