This SAS tutorial video will show you how to create a new variable with Base SAS. During the step-by-step video, you will see exactly how to create and modify numeric and character variables using assignment statements in a DATA step. Watch and learn… To learn more about the steps in
Tag: programming
Over the holidays I was having a discussion with my cat, Ms. Trixie Lou. A question that often arises during the first programming class is the following: how do I find the variables that are in common to these two or three data sets? As it turns out, Ms. Trixie
Dear Miss SAS Answers, I have read through a few Dear Miss SAS Answers blog posts, but I cannot seem to find what I am looking for. I need to extract only the second duplicate from a whole list of duplicates per account number. Is there a way to
A SAS user (who lives in the the US) emailed me a question about SAS functions. He was reading UTC (Coordinated Universal Time) datetime values from server logs, and to make future calculations and comparisons easier, he wanted to transform the value to local datetime. The INTNX() function worked great, but
In the Star Wars movie, Obi-wan could just wave his hand, mutter a few words, and the stormtroopers would "move along". How the power of the Force makes ridding yourself of problematic characters so much easier! I recently was invited to become an alternate instructor for Ron Cody’s SAS Business
Dear Miss SAS Answers, In PROC REPORT can I use one calculated (computed) variable in the calculation of another computed variable? In the example below, I’m trying to use the value of the Bonus column to calculate the Total column: compute Bonus; Bonus =sal.sum*0.05; endcomp; compute Total; total=sum(sal.sum, Bonus.sum); endcomp;
If you’ve taken one of my SAS classes you may recall “Mark’s 3 rules of programming”, the first of which is “Lazy programmers are GOOD programmers.” One of the things I love about best about SAS programming is the plethora of functions and shortcuts built into the language, all designed
As far as numbers go, the number zero is rather mysterious for data. Is it something or is it nothing? What happens when you have missing data but enter 0? This topic triggered an intriguing discussion in my recent Programming 2: Data Manipulation Techniques class. In this post I’d like
Have you used multivariate procedures in SAS and wanted to save out scores? Some procedures, such as FACTOR, CANDISC, CANCORR, PRINCOMP, and others have an OUT= option to save scores to the input data set. However, to score a new data set, or to perform scoring with multivariate procedures that
Many SAS users receive data in the form of CSV (Comma Separated Value) files, and need to convert them to SAS data sets. A typical record in a CSV file might look like this: Jeter,Derek,1995,,234,”22,600,000” Note the following about the record above: There is no data for the fourth field,