LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 1999, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 20 Apr 1999 09:08:49 +0100
Reply-To:     Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Subject:      Re: Unfinished SAS-L Live from Miami Beach business
In-Reply-To:  <003801be8abf$bdafe340$037b7b7b@dave.jadetek>

May I express my surprise at you two old-timers - Dave and William (intended as a mark of respect !)

Whether context is interactive or batch, the &sysdate variable, may still be pointing to "yesterday" ! Very simply as Ray Pass shows below, today() provides the easy working alternative, especially when operating within a data step. Of course it is also available for use within %sysfunc() for those cases where appropriate.

My own "pet solution" is been directed at both issues - &sysdate becoming "yesterday" at midnight, as well as seeking to put the date into titles/footnotes. Having not found any weakness with %sysfunc() on supporting versions, I use it in a very simple macro %now %macro now() /cmd stmt; %sysfunc( datetime(), datetime23.2 ) %mend now;

footnote2 " as executed at %now ";

has a simplicity to it, don't you think ?

preferable, so long as the recipients are happy to receive timestamps rather than just a date ( I think it sometimes helps to identify *when* during a day)

Regards....

William W. Viergever <wwvierg@IBM.NET> writes >From: "William W. Viergever" <wwvierg@IBM.NET> >Subject: Re: Unfinished SAS-L Live from Miami Beach business >Comments: To: Ray Pass <raypass@WORLDNET.ATT.NET> >To: SAS-L@UGA.CC.UGA.EDU >In-Reply-To: <4.1.19990419172528.00caa2a0@postoffice.worldnet.att.net> > >Here's my standard chunk of code for all my batch jobs (the "source" does change >however: > >data _null_; > call symput("fdate",trim(left(put("&sysdate"d,worddate.)))); >run; >*******************************************************************************; >*-- our standard footnotes; >footnote1 "Source: DHS' CY 1996 - 1998 Medi-Cal inpatient paid claims tapes"; >footnote2 "Prepared by: Viergever & Associates, Sacramento, CA"; >footnote3 "[&pgm1..sas, &systime &sysday, &fdate]"; >*******************************************************************************;

S David Riba <dave@JADETEK.COM> writes >>Of course you can use any output date format you like. I leave it to my >>colleague DR to post the non %sysfunc solution (with or without &sysdate) >>since he was in such an anti-%sysfunc at the time :-) Go Dave! > >The gauntlet has been thrown! I love a challenge. Since William Viergever >had the advantage of scavenging some existing code, here is an alternate way >of solving the Live from SAS-L problem WITHOUT %sysfunc. It uses my old >buddy, CALL EXECUTE -- > >data _null_ ; > call execute('footnote "Today is ' || > put(input("&sysdate",date7.),mmddyy10.) || ' " ;' ) ; >run; > >Satisfied, Ray? > >Dave >---------------------------------------------------------------------------- > S. David Riba INTERNET: dave@JADETEK.COM > JADE Tech, Inc. http://www.jadetek.com > P O Box 4517 > Clearwater, FL 33758 > VOICE: (727) 726-6099 A SAS Institute Quality Partner > > SAS. It's not just an attitude > > >-----Original Message----- >From: Ray Pass <raypass@WORLDNET.ATT.NET> >Newsgroups: bit.listserv.sas-l >To: SAS-L@UGA.CC.UGA.EDU <SAS-L@UGA.CC.UGA.EDU> >Date: Monday, April 19, 1999 5:45 PM >Subject: Unfinished SAS-L Live from Miami Beach business > > >>In one of the more lively discussions at the session, the question to be >>answered was how to put the automatic variable &sysdate out in a footnote >>with a format other than the default date7. Since none of us were syntax >>certified, we couldn't quite come up with the correct code at the moment, >>although we knew how to do it. I forgot about it for a few days and I just >>now remembered to post "an" answer. >> >>One solution would be to use the today() function instead of the &sysdate >>automatic variable, and take advantage of the fact that the %sysfunc >>function can have an output format associated with it. It's easy enough: >> >>footnote "%sysfunc(today(),mmddyy10.)"; >> >>Of course you can use any output date format you like. I leave it to my >>colleague DR to post the non %sysfunc solution (with or without &sysdate) >>since he was in such an anti-%sysfunc at the time :-) Go Dave! >> >>Ray >> >> >>*------------------------------------------------* >>| Ray Pass voice: (914) 693-5553 | >>| Ray Pass Consulting fax: on request | >>| 5 Sinclair Place | >>| Hartsdale, NY 10530 e-mail: raypass@att.net | >>*------------------------------------------------* > >[ A MIME text / x-vcard part was included here. ] >

-- Peter Crawford (_knowledge_ is a poor substitute for *real* experience, but they make a great team)


Back to: Top of message | Previous page | Main SAS-L page