Download presentation
Presentation is loading. Please wait.
Published byBrenda Brooks Modified over 9 years ago
1
MASUG December 5, 2005
2
Agenda Announcements Announcements Tips & Tricks Tips & Tricks Presentation: Presentation: Working Smarter, Not Harder with DDE: Did I Really Spend All That Time Formatting My Report in Excel? Working Smarter, Not Harder with DDE: Did I Really Spend All That Time Formatting My Report in Excel? Giveaways Giveaways Next Meeting Next Meeting
3
Announcements SAS Training Center at U of M – if interested in registering, need to do so approx. 3 weeks prior to course date. 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 SUGI 31 – San Francisco March 26-29, 2006
4
Tips & Tricks Using Macro Variables for Automation – Michael Bates Using Macro Variables for Automation – Michael Bates
5
When Proc Print Isn’t Enough MASUG Tips & Tricks Dec 5, 2005 Walt Smith FedEx
6
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!
7
The plain example title1 "Ground History Update"; proc print label; var packages netrev adv adr yld wpp; var packages netrev adv adr yld wpp; by notsorted svctxt; by notsorted svctxt; id date; id date;run;
8
The result:
9
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 } ; style( header ) = { background=cxadbade foreground=black } ; var packages netrev; var packages netrev; var adv adr / var adv adr / style( data ) = { background=cxffbb33 foreground=black } ; style( data ) = { background=cxffbb33 foreground=black } ; var yld wpp ; var yld wpp ; by notsorted svctxt; by notsorted svctxt; id date / id date / style( data ) = { background=cxadbade foreground=black } style( data ) = { background=cxadbade foreground=black } style( header ) = { 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; file mail; put "!EM_ATTACH!('Ground_Update.html')"; put "!EM_ATTACH!('Ground_Update.html')";run;
10
The result:
11
Tips & Tricks Getting variable names into a macro variable: 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;
12
Tips & Tricks Using only some variables: 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;
13
Tips & Tricks Using only some variables cont’d: Using only some variables cont’d: %put &varnames3; id and gender and j_class
14
Tips & Tricks Creating an index Creating an index PROC SQL; CREATE INDEX CATEGORY ON libref.MOVIES; QUIT;
15
Tips & Tricks Creating a compound index Creating a compound index PROC SQL; CREATE INDEX CATRATE ON libref.MOVIES (CATEGORY, RATING); QUIT;
16
Tips & Tricks Removing an index * 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
17
Our Main Presentation
18
Free Stuff
19
Next Meeting Tentative location – FedEx Tentative location – FedEx Would like to invite SAS speaker Would like to invite SAS speaker Topics of interest? Topics of interest? Will be back to Thursday 3-5pm Will be back to Thursday 3-5pm Other suggestions? Other suggestions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.