Download
slide1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
A Useful Footnote Martha Cox Population Health Research Unit Community Health & Epidemiology Dalhousie University PowerPoint Presentation
Download Presentation
A Useful Footnote Martha Cox Population Health Research Unit Community Health & Epidemiology Dalhousie University

A Useful Footnote Martha Cox Population Health Research Unit Community Health & Epidemiology Dalhousie University

119 Vues Download Presentation
Télécharger la présentation

A Useful Footnote Martha Cox Population Health Research Unit Community Health & Epidemiology Dalhousie University

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. A Useful FootnoteMartha CoxPopulation Health Research UnitCommunity Health & EpidemiologyDalhousie University

  2. Make the output tell you where it came from • Program Name • Date and time it was submitted • Who ran it

  3. Program Name • SAS system option SYSINSpecifies the default location of SAS source programs • SAS function GETOPTIONReturns the current value of the specified system or graphics option getoption(sysin) → full operating system path & filename

  4. %SYSFUNC a way to execute a data step function without being in a data step If the result might contain special characters or mnemonic operators, use %QSYSFUNC instead.

  5. Program Name %qsysfunc(getoption(SYSIN))

  6. Date and Timethe program was submitted

  7. Automatic Macro Variables &sysdate 19OCT07 &sysdate9 19OCT2007 &systime 16:22 &sysuserid MCOX &sysvlong 8.02.02M0P012301

  8. Date Submitted %sysfunc(today(), yymmddD10.)

  9. Who Ran The Program SAS Automatic Macro Variable: &sysuserid This variable has a length of 12. "MCOX " So to use it in a sentence, we need to trim it.

  10. Who Ran The Program %sysfunc(trim(&sysuserid))

  11. proc freq data=shrug.sample; tables sex; footnote1 "Program: %qsysfunc(getoption(SYSIN)) submitted %sysfunc(today(), yymmddD10.) at &systime. by %sysfunc(trim(&sysuserid))."; run; Putting it all together

  12. The FREQ Procedure Patient Gender Cumulative Cumulative sex Frequency Percent Frequency Percent -------------------------------------------------------- F 4 40.00 4 40.00 M 6 60.00 10 100.00 Program: DISK$USER1:[MCOX.SHRUG]FOOTVMS.SAS;21 submitted 2007-10-12 at 17:42 by MCOX. The Results (VMS batch job)

  13. Notes about Display Manager • SYSIN is blank • &systime = the time you started your SAS session; not when that bit of code was run • &sysuserid = the 'registered' PC user(See Control Panel → System.)

  14. Questions?