This article introduces how to solve the pirate game with a recursive solving algorithm in SAS, and how to analyze and visualize the law behind the complex logic of the pirate game. If you join in a pirate game next time, you can know your destiny ahead of time to reap the benefits and avoid getting killed.
Tag: data step
Leonid Batkhan describes and discusses pros and cons of 3 different algorithms and SAS code implementations to calculate length of overlap of date/time intervals and integer intervals in general.
Leonid Batkhan introduces multipurpose TRIMS function that removes any leading, trailing or both leading and trailing characters from SAS strings.
Just because you are using CAS actions doesn't mean you can forget about the powerful SAS DATA step. The dataStep.runCode CAS action is here! Welcome back to my SAS Users blog series CAS Action! - a series on fundamentals. I've broken the series into logical, consumable parts. If you'd like
SAS' Leonid Batkhan shows how to cut away ANY unwanted trailing characters (not just blanks) from SAS text strings to clean up your data.
SAS' Leonid Batkhan shows you how to remove ANY leading characters (not just blanks) from text strings to tidy up your data.
SAS' Leonid Batkhan reveals how to use versatile iterative DO loops with index variable pertaining to SAS DATA steps.
In many programming languages, there is a function named eval() that can be used to evaluate an expression and return the result at run time. For example, in Python, the eval() function parses the expression passed to it and runs a Python expression or code within the program. Even Python
SAS' Leonid Batkhan explains the data cleansing task of removing unwanted repeated characters in SAS character variables.
SAS' Leonid Batkhan reviews SAS functionality related to the character strings quoting/unquoting, then dives deep into unquoting SAS character variables.
In natural language processing, word vectors play a key role in making technologies such as machine translation and speech recognition possible. Let's talk about how to transform word vector tables from long to wide in SAS, so we can potentially get sentence vectors to process further.
In honor of Valentine’s day, we thought it would be fitting to present an excerpt from a paper about the LIKE operator because when you like something a lot, it may lead to love! If you want more, you can read the full paper “Like, Learn to Love SAS® Like”
This article discusses how to use SAS to filter variables in a dataset based on the percentage of missing values or duplicate values. The missing value statistics can be implemented by either DATA step programming on your own or reusing the existing powerful PROC FREQ.
The DATA step remains a popular way to create and manipulate SAS data sets. Whether you are reshaping a data set entirely or simply assigning values to a new variable, there are numerous tips and tricks that you can use to save time and keystrokes.
After a marathon of a season, 162 games in each team's schedule to be precise, the stakes for Major League Baseball are higher in October, and postseason play is underway. Whether it's the renewal of an old rivalry, redemption for last year's runners up, or rooting for this season's breakout
In many movies, there is often a scene where the star says "We can do this the easy way, or the hard way" (and the hard way usually involves quite a bit of pain). So it is with interrogations ... and so it is with writing SAS code! Today I'm
The purpose of this blog post is to demonstrate a SAS coding technique that allows for calculations with multiple variables and multiple observations across a SAS dataset. This technique can be useful for working with time series, clinical trials, - in any data step calculations involving values from different observations.
I started young. Since I was 9 years old, I’ve always loved cooking delicious, tasty and healthy food, and feeding friends and family. My aunt still remembers the delicious chocolate soufflé that trembled and shook but would never collapse that I made for them when I was 18! Word spread.
A reader posed a question in the comments to an earlier Jedi SAS Trick, asking how to write the results of a DS2 DATA _NULL_ program to a text file. It's an interesting question, as DS2 currently has no text file handling statements or capabilities. Take, for example, this traditional
I was answering questions about SAS in a forum the other day, and it struck me how much easier it is to help folks if they can provide a snippet of data to go along with their program when asking others to help troubleshoot. This makes it easy to run
I'm gearing up to teach the next "DS2 Programming Essentials with Hadoop" class, and thinking about Warp Speed DATA Steps with DS2 where I first demonstrated parallel processing using threads in base SAS. But how about DATA step processing at maximum warp? For that, we'll need a massively parallel processing
While perusing the SAS 9.4 DS2 documentation, I ran across the section on the HTTP package. This intrigued me because, as DS2 has no text file handling statements I assumed all hope of leveraging Internet-based APIs was lost. But even a Jedi is wrong now and then! And what better
Stick to the basics. Did you ever get that advice? Two of the papers at MidWest SAS Users Group 2013 used that most fundamental of SAS processing concepts—the Program Data Vector—to show why users might encounter unexpected errors in their DATA step programs. In The Secret Life of DATA STEP,
Sometimes I need to "disassemble" a SAS data set into a DATA step program. It's kind of like creating a "freeze-dried" version of the data that you can carry around and use anywhere, re-hydrating it in the SAS session where you next need it. Some example uses for this: Build
Many of you know Mike Zdeb. He's a long-time SAS user and frequent presenter at SAS conferences. Zdeb is also a reviewer of many SAS Press books and author of his own SAS book, Maps Made Easy Using SAS. Zdeb contacted me after he read the May SAS Tech Report
Now, we all know by now that I'm not a programmer (that makes me very sad sometimes and may frustrate some of you at times), but I know a good paper and presentation when I see one. Christopher Bost knows how to teach a topic. I went to his Tuesday
Today, I have truly taken a chapter from the book - perhaps in more ways than one. I happened to notice that Art Carpenter's most recent book is titled, "Carpenter's Guide to Innovative SAS Techniques." Of course, you know that linking innovation and SAS are going to be a trigger
I think this DATA step Post-It author may be a bit like my mother. When I was a child, my mother was always coaching me on two things: being independent and being efficient. I believe those are the two traits she considered most admirable in a person. It's little wonder
Art Carpenter’s newest book, Carpenter’s Guide to Innovative SAS Techniques, offers advanced SAS programmers an all-in-one programming reference that includes advanced topics not easily found outside the depths of SAS documentation or more advanced training classes. No matter how you approach the use of SAS software, the techniques provided in
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