190 likes | 394 Views
MASUG. December 5, 2005. Agenda. Announcements Tips & Tricks Presentation: Working Smarter, Not Harder with DDE: Did I Really Spend All That Time Formatting My Report in Excel? Giveaways Next Meeting. Announcements.
E N D
MASUG December 5, 2005
Agenda • Announcements • Tips & Tricks • Presentation: • Working Smarter, Not Harder with DDE: Did I Really Spend All That Time Formatting My Report in Excel? • Giveaways • Next Meeting
Announcements • SAS Training Center at U of M – if interested in registering, need to do so approx. 3 weeks prior to course date. • SUGI 31 – San Francisco March 26-29, 2006
Tips & Tricks • Using Macro Variables for Automation – Michael Bates
When Proc Print Isn’t Enough MASUG Tips & Tricks Dec 5, 2005 Walt Smith FedEx
When you want to send a simple report • Proc print handles simple tables quite well • The simple output is just a bit plain (as it should be) • SAS 9 allows style changes that are easily accessible • No need for proc template and all that scary stuff!
The plain example title1 "Ground History Update"; proc print label; var packages netrev adv adr yld wpp; by notsorted svctxt; id date; run;
Now add some style: ods html file="Ground_Update.html" style=styles.sasweb; options missing=' '; title1 "Ground History Update"; proc print label style( header ) = { background=cxadbade foreground=black } ; var packages netrev; var adv adr / style( data ) = { background=cxffbb33 foreground=black } ; var yld wpp ; by notsorted svctxt; id date / style( data ) = { background=cxadbade foreground=black } style( header ) = { background=cxadbade foreground=black } ; run; ods html close; filename mail email "wjsmith1@fedex.com" subject="Monthly Update"; data _null_; file mail; put "!EM_ATTACH!('Ground_Update.html')"; run;
Tips & Tricks • Getting variable names into a macro variable: proc contents data = my_dataset noprint out = my_outset; run; proc sql noprint; select distinct name into :varnames separated by ‘ ‘ from my_outset order by varnum; quit;
Tips & Tricks • Using only some variables: proc sql noprint; select distinct name into :varnames3 separated by ' and ' from my_outset where varnum in (1, 2, 4) order by varnum; quit;
Tips & Tricks • Using only some variables cont’d: %put &varnames3; id and gender and j_class
Tips & Tricks • Creating an index PROC SQL; CREATE INDEX CATEGORY ON libref.MOVIES; QUIT;
Tips & Tricks • Creating a compound index PROC SQL; CREATE INDEX CATRATE ON libref.MOVIES (CATEGORY, RATING); QUIT;
Tips & Tricks • Removing an index * PROC SQL; DROP INDEX CATRATE FROM libref.MOVIES; QUIT; * Previous 3 slides adapted from Sample 1557:Exploring the World of Indexes by Kirk Paul Lafler on support.sas.com
Next Meeting • Tentative location – FedEx • Would like to invite SAS speaker • Topics of interest? • Will be back to Thursday 3-5pm • Other suggestions?