12.07.2015 Views

Old Friends, New Features: What's new in SUMMARY and ... - NESUG

Old Friends, New Features: What's new in SUMMARY and ... - NESUG

Old Friends, New Features: What's new in SUMMARY and ... - NESUG

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

format month mthfmt.;run;/*-- Send output to HTML --*/ods html body="C:\temp\preloadFmt1.htm";/*-- Now, do the report --*/proc summary pr<strong>in</strong>t sum mean completetypes;class month / preloadfmt order=data;var dailyTotals;run;ods html close;And now the ODS - HTML output…PA Philly 100000NC Cary 50000NC Raleigh 360000PA Pittsburgh 75000PA Philly 450000NC Raleigh 50000PA Philly 800000NC Cary 30000NC Raleigh 50000;/*-- Query def<strong>in</strong>es class levels <strong>and</strong> order --*/data query;<strong>in</strong>put state $1-2 city $4-13;datal<strong>in</strong>es;PA PhillyPA PittsburghNC RaleighNC Durham;run;ods html body="C:\temp\classdata1.htm";proc tabulate data=revenues classdata=queryexclusive;class state city / order=data;var amt;table state*city, amt*(n sum);run;ods html close;And the result<strong>in</strong>g HTML output…The next example shows how classdata= <strong>and</strong>exclusive can be used to zero-<strong>in</strong> on a target set of classlevels that may or may not be conta<strong>in</strong>ed <strong>in</strong> the <strong>in</strong>put data.Notice that the class comb<strong>in</strong>ation NC/Durham does notoccur <strong>in</strong> the <strong>in</strong>put data but does appear <strong>in</strong> the output.data revenues;<strong>in</strong>put state $1-2 city $4-13 amt;datal<strong>in</strong>es;PA Pittsburgh 200000PA Philly 500000NC Raleigh 250000ConclusionsThe examples above illustrate just two of over thirty <strong>new</strong>features of PROC <strong>SUMMARY</strong> <strong>and</strong> PROC TABULATEfor Version 7 aimed at reduc<strong>in</strong>g the need for pre <strong>and</strong> postprocess<strong>in</strong>g data to get what you really want.TrademarksSAS is a registered trademark of SAS Institute Inc. <strong>in</strong> theUSA <strong>and</strong> other countries. ® <strong>in</strong>dicates USA registration.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!