LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 18 May 2001 12:51:17 -0600
Reply-To:     Darran Zenger <DZENGER@KLUNE.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Darran Zenger <DZENGER@KLUNE.COM>
Subject:      Re: Macro Variable Question
Comments: To: "Cassell.David@EPAMAIL.EPA.GOV" <Cassell.David@EPAMAIL.EPA.GOV>
Content-Type: text/plain; charset="iso-8859-1"

Thanks to those who send me suggestions now to combat this and learn more. I appreciate it. I have been able to identify what I need and work around what was suggested.

Thanks. Darran

Darran Zenger The SAS System Programming Klune Industries, INC Spanish Fork, UT

-----Original Message----- From: David L. Cassell [mailto:Cassell.David@EPAMAIL.EPA.GOV] Sent: Friday, May 18, 2001 11:06 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Macro Variable Question

Darran Zenger wrote: > Since most of you know I'm rather new here I've got a Macro question in > need. I'm wanting to put the current time in a title, but I don't want to > use the automatic variable &systime, as I want the actual date the job was > processing, not when the SAS session started.

Well, since you're new, you'll want to learn about searching the SAS-L archives for cool stuff. Search the SAS-L archives at: http://www.listserv.uga.edu/archives/sas-l.html [I tend to keep my own copies of posts which I find interesting or memorable, and then search my own file first.]

Here's a snippet of an old post which contains just what you wanted. But this subject comes up about once a month, so you can find many other posts with similar messages.

| Subject: formatting a macro variable | From: peter.crawford@db.com | Date: 06/08/00 03:15 PM | | There is now a built in formatting feature in the macro language -- in %sysfunc() | The following notes assume you want to assign into a macro var, but that isn't | allways necessary. | %let <macvar name to receive formatted value> | = %sysfunc( <some data step function creating a value > , | <required format to present function result> | ); | for example ( perhaps this is what you want ):- | %let maxNumb = %sysfunc( max( &a, &b, &c ), comma9 ); | and | %let titleDat = %sysfunc( date(), weekdate29 ) ;

So you can get the date/time in whatever SAS format you'd like, by using this technique. Thanks, Peter!

HTH, David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician


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