SAS Enterprise Guide: Pick a Winner Randomly

To pick the winners of the 50 Keys to Learning SAS Stored Processes book, my first thought was to print the list and then put everyone’s name in a hat. Angela brilliantly suggested that we use one of the SAS Random functions.  However, since there was a list  of names I really needed a random number between two values.  This brought to mind the MS Excel RANDBETWEEN function – but how do you translate that function to SAS Enterprise Guide code? Getting a Random Number between Two Values I have to admit for a one-off process like picking a random number,  MS Excel would be my goto tool. MS Excel has a function called RANDBETWEEN() that allows you to provide two numbers and it then selects a random value between those two numbers.  I tried to use the SAS RANDOM functions – but I couldn’t figure out how to make it work in 5 minutes (my personal patience meter) so I needed an expert.  Consult with a SAS Expert Lucky for me SAS-L had the answer – it’s one of the places I search for SAS tips when I’m stuck.  In August 2000, Mark Terjeson wrote a post called “Just […]

Example 9.27: Baseball and shrinkage

To celebrate the beginning of the professional baseball season here in the US and Canada, we revisit a famous example of using baseball data to demonstrate statistical properties. In 1977, Bradley Efron and Carl Morris published a paper about the Jame…

All the possible uses for PROC STP

PROC STP is a new procedure for SAS 9.3 Stored Processes. It’s so new and different that I have not had the opportunity to use it yet in a customer engagement. When writing about it for the now released “The 50 Keys to Learning SAS Stored Processes” bo…

SAS Stored Processes: Excerpt from STP Book

We excerpted this post from The 50 Keys to Learning SAS Stored Processes. Chapter 2: Creating Simple Stored Processes BASE SAS gives programmers the exponential ability to query and report about data from their desktops; however, this limitation means that a user can access the data from their desktops only. As an organization’s reporting needs grow, more individuals need to quickly retrieve and analyze similar information. As a result, a small group with access to the data unintentionally becomes report gatekeepers. Other members of the organization have to talk to these gatekeepers for even the simplest piece of data. Before you convert a SAS program to a stored process, you must consider whether the program is a good candidate for conversion. Although any SAS program can be a stored process, this does not mean that all programs should be a stored process. Programs that require user input, run on user demand, and generate output are typically better candidates than those programs scheduled to run overnight, take a long time to run or require no user modifications. In Chapter 1, “Getting Started with Stored Processes” you learned how to register a stored process. In this chapter, you will convert an existing […]

Graphs are easy with SAS 9.3

ODS Graphics have matured.  With SAS 9.2, GTL and SG procedures were a new direction for creating analytical graphs in SAS. The motivation and design of the GTL framework and the SG procedures was driven primarily by the needs of the procedure writers…