Tag: List

SAS Data Driven Programming: My 4 Favorite Techniques

I use relatively fixed patterns in my SAS  programming life. For so called data driven programming (or dynamic programming), I used the following 4 techniques, chronologically: macro array call execute list processing for each loop For a quick demo, I will start with a simple scenario in which the data set sashelp.zipcode should be spitted […]

List Processing With SAS (2): List Creating II

%range is a genetic list creator. To apply data driven programming technique, we need to fetch metadata from source data dynamically, for example, to get all variables from a input dataset. You can easily make it by 1. PROC SQL, from a SAS dictionary table, or macro variable by SELECT INTO; or 2. Proc Contents; […]

List Processing With SAS (1): List Creating I

Suppose you have 10 datasets, literally ds1, ds2, …ds10 and you need to concatenate them all. You may first get a quick shortcut set ds1-ds10. If such list members were generated dynamically (and may hold a form like ds1a, ds2a,… ds10a) , you will probably come out a macro solution:    %macro doit;        data […]

List Processing With SAS: A Github Repository

I have a function like macro (recursive version) to create a sequence: %macro _list(n,pre=ff);     %if &n=1 %then &pre.1;      %else %_list(%eval(&n-1)),&pre.&n; %mend _list; %put %_list(3); *produces ff1, ff2, ff3; But when I read one of Ian Whitlock’s papers, Names, Names, Names – Make Me a List (SGF 2007, SESUG 2008),  I say: stop! I’m […]

Map and Reduce in MapReduce: a SAS Illustration

In last post, I mentioned Hadoop, the open source implementation of Google’s MapReduce for parallelized processing of big data. In this long National Holiday, I read the original Google paper, MapReduce: Simplified Data Processing on Large Clusters by Jeffrey Dean and Sanjay Ghemawat and got that the terminologies of “map” and “reduce” were basically borrowed […]