Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 How to Quickly Customize your PC SAS Session PhilaSUG GSK October 27, 2004 Mary Anne Rutkowski Kathy Harkins Senior Statistical Programming Analysts.

Similar presentations


Presentation on theme: "1 How to Quickly Customize your PC SAS Session PhilaSUG GSK October 27, 2004 Mary Anne Rutkowski Kathy Harkins Senior Statistical Programming Analysts."— Presentation transcript:

1 1 How to Quickly Customize your PC SAS Session PhilaSUG GSK October 27, 2004 Mary Anne Rutkowski Kathy Harkins Senior Statistical Programming Analysts Merck & Company

2 2 Introduction It’s easy to customize your PC SAS session! With a “double click” of a Windows desktop shortcut you can launch PC SAS and automatically assign customized SAS settings.

3 3 Who can Benefit? Any PC SAS user Works for Versions 6.x, 7.x, 8.x, or 9.x although some parts of the shortcut are version dependent You and members of your project team

4 4 What does the shortcut do? Windows desktop shortcut that: –Launches SAS –Executes a user defined startup SAS program Sets system options, macro variables, and library definitions and/or executes SAS code/macros in an automatic and reusable way –Defines a default startup location for Opening and Saving SAS files

5 5 When / Where / How… When: The shortcut is used every time you want to launch SAS Where: The shortcut is created once and saved to your desktop How:Double-Click on the shortcut

6 6 Why To save time To ensure consistency To share option settings, macro variables, macro code among project team members

7 7 Steps to Follow STEP 1: Create the Windows Desktop Shortcut STEP 2: Create your STARTUP.SAS program STEP 3: Double Click the Shortcut to Launch SAS Note: Steps 1 & 2 are interchangeable

8 8 STEP 1: Create Desktop Shortcut Right click on any open space on your desktop Select New  Shortcut from the Menu Enter the Shortcut Location: c:\Documents and Settings\your_name_here\Desktop Select Next

9 9 STEP 1: Create Desktop Shortcut Enter the Shortcut name: SAS Startup Project ABC Select Finish

10 10 Customize the Shortcut - Target Right click the shortcut “SAS Startup Project ABC” Select Properties from the Menu Next, Select the Shortcut tab Enter Target: “location of SAS on your PC” –autoexec “location of your startup.sas program” -SASinitialfolder “default location for SAS programs” "C:\Program Files\SAS Institute\SAS\V8\sas.exe" -autoexec "c:\DrugABC\prot001\utility\startup.sas“ -SASinitialfolder "C:\DrugABC\Prot001\pgm_analysis"

11 11 Customize the Shortcut – Start In (Continued) “Start In” defines the default location for the SAS editor to locate your program files (SAS V6.x and V7.x only). Enter Start in: “ C:\DrugABC\Prot001\pgm_analysis” Click Apply For SAS V8.x or higher, Use the -SASinitialfolder syntax on the Target field instead. Change Icon if desired

12 12 STEP 2: Create Startup.SAS Create Global macro variables to define input directories for your SAS programs: %let drive = c:; %let protpath = &drive\DrugABC\Prot001; Create Global macros variables to further define file locations by file type: %let datadir = &protpath\data_analysis; %let rawdir = &protpath\data_raw; Create Global macro variables to further define macro libraries: %let macdir = &protpath\macrolib ;

13 13 STEP 2: Create Startup.SAS (Continued) Create Global macro variables to define output directories for LOG, LIS, tabular or graphical outputs from your SAS programs: %let logdir = &protpath\out_logs; %let listdir = &protpath\out_listings; %let graphdir = &protpath\out_graphics; %let tabledir = &protpath\out_tables; Create Global macro variables to define SAS program locations: %let pgmdir = &protpath\pgm_analysis; %let setupdir = &protpath\pgm_setup; Create library references to be used in your SAS programs: libname datadir "&datadir"; libname rawdir "&rawdir";

14 14 STEP 2: Create Startup.SAS (Continued) Define options with the SAS OPTIONS command to customize your SAS Session: option mautosource mstored noxwait xsync nomprint pageno=1 sasautos=("&macdir" "&smacdir" "q:\maclib" sasautos); Make macro calls to eliminate the need to call them in each program: * Call macro rtfsymbl and generate reference macro dagger_; %rtfsymbl(groups=Referenc); Define frequently used formats: Proc Format; value riskfmt. = 'missing‘ -99 = 'undefined‘ 0.5 = ' =30';

15 15 STEP 2: Create Startup.SAS (Continued) Define project specific macro variables: %let last_vst=8; *** last visit number for treatment phase ***; %let trtweek=%str(1 2 3 4 5); *** treatment weeks ***; %let __pvalue=0.05; *** p-value of signifiant ***; Embed macro code: %macro mwkdef; select; when (.<rel_dy<=-1 and phase='Pre-Study') week= -1; when ((. < rel_dy <=1) and phase='Washout') week= 0 ; when ((2<= rel_dy <= 11) and phase in ('Treatment' 'Post-Study')) week= 1 ; when ((12<= rel_dy <= 21) and phase in ('Treatment' 'Post-Study')) week= 2 ; otherwise; end; %mend mwkdef;

16 16 STEP 3: Execute the Shortcut Double-Click on your SAS Startup Project ABC Shortcut.

17 17 STEP 3: Execute the Shortcut (Continued) Click on file….open…..

18 18 Advice on Utilizing the Shortcut Save your STARTUP.SAS program on a share drive. All team members can share and utilize the same shortcuts and settings Create multiple shortcuts on your desktop for example: - development, test, or production versions of code - version for each of your current projects

19 19 In Recognition Thank you to Margaret Coughlin, Donna Usavage and Ellen Asam for their expert guidance. Q U E S T I O N S …. kathy_harkins@merck.com mary_anne_rutkowski@merck.com kathy_harkins@merck.com


Download ppt "1 How to Quickly Customize your PC SAS Session PhilaSUG GSK October 27, 2004 Mary Anne Rutkowski Kathy Harkins Senior Statistical Programming Analysts."

Similar presentations


Ads by Google