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 (October 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 27 Oct 2008 09:12:58 -0400
Reply-To:     "Howard Schreier <hs AT dc-sug DOT org>"
              <schreier.junk.mail@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Howard Schreier <hs AT dc-sug DOT org>"
              <schreier.junk.mail@GMAIL.COM>
Subject:      Re: Add Timestamp to dataset's name

On Mon, 27 Oct 2008 00:15:42 -0500, sas 9 bi user <sas9bi@GMAIL.COM> wrote:

>All - > >Say I have > >data b; >set a; >run; > >I want to add a timestamp to B. When I try to do the below it errors out. > > data b_&systfunc( datetime() ); >set a; >run; > >This is what I would like B to be named as: > >b_10/27/2008_12:14AM > >Note - Date/time is what sysfunc generates at time of call (so the above is >at the time of this email writing for example). > >Any ideas? > >Thanks!

1. SYSFUNC is a macro function, not a macro variable, so prefix it with a percent sign rather than an ampersand.

2. SYSFUNC is spelled without a "T".

3. Include a format to express the datetime value as shown rather than as a string of digits.

4. Colons and slashes are not valid in data set names, so translate them to underscores.


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