As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Tips Talk:Appending datasets efficiently

From sasCommunity
Jump to: navigation, search

Linda,
__ This is an excellent TIP on a very important topic, concatenating (appending).
Many people observing your simple yet elegant advice will save time
and computer cycles for SAS users (themselves) and company computers.
THANKS! Charlie Shipp 14:23, 24 July 2009 (UTC)


Good tip. Rearranged text and examples --Art Carpenter 18:48, 30 July 2009 (UTC)


Excellent Tip! 'Tip Ready' --Nancy 23:26, 31 July 2009 (UTC)

Better reference

Should link to Concatenation Operations with PROC APPEND.--Howles 15:07, 5 September 2009 (UTC)

Merge, anyone?

You can append using merge, as well. :-) -- chang_y_chung 22:12, 18 January 2011 (UTC)

/* test datasets */
data class1;
  set sashelp.class;
  class = 1;
run;
 
data class2;
  set sashelp.class;
  class = 2;
run;
 
/* merge to append data */
data class12;
  merge class1 class2;
  by class;
  drop class;
run;
/* on log -- in part
NOTE: There were 19 observations read from the data set WORK.CLASS1.
NOTE: There were 19 observations read from the data set WORK.CLASS2.
NOTE: The data set WORK.CLASS12 has 38 observations and 5 variables.
*/
 
/* did it work? */
proc print data=class12;
run;
  • OK, but I'll wait for Chang to describe a scenario where MERGE is the advantageous tool for concatenation.--Howles 23:20, 26 January 2011 (UTC)