| Date: | Tue, 21 Feb 2012 10:12:18 -0500 |
| Reply-To: | Quentin McMullen <qmcmullen.sas@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Quentin McMullen <qmcmullen.sas@GMAIL.COM> |
| Subject: | Re: altlog with timestamp |
|
| In-Reply-To: | <0F548D585A011E4484D77C7B095EC53F1A5AD475@TAC-CMS001.prod.ds.russell.com> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Thanks Mark,
Sorry for being dense, but... where would I put the %let statement to
make the timing work out?
That is, I thought (perhaps incorrectly) that I need to specify
-altlog at invocation. So I've been trying it in my config file and
on the invocation command. I don't think I can put a %let statement
in my config file (can I?). I think putting %let in the autoexec
would be too late (isn't it)?
Just to add something beyond a question, here is my new favorite
format for timestamps yyyymmddThhmmss:
%put %sysfunc(datetime(),b8601dt);
20120221T100848
Thanks,
--Quentin
On Tue, Feb 21, 2012 at 9:59 AM, Terjeson, Mark <Mterjeson@russell.com> wrote:
> Hi Quentin,
>
> One alternative is to prespecify with SAS:
>
>
> %let yyyymmdd=%sysfunc(putn(%sysfunc(date()),yymmddn8.));
>
> -altlog "C:\junk\mylog_&yyyymmdd..log"
>
>
> for date and time:
>
> %let yyyymmdd=%sysfunc(putn(%sysfunc(date()),yymmddn8.));
> %let tmptime=%sysfunc(compress(%sysfunc(putn(%sysfunc(time()),time8.)),:));
> %let hhmmss=%sysfunc(putn(&tmptime,z6.));
> %let yyyymmddhhmmss=&yyyymmdd&hhmmss;
>
> -altlog "C:\junk\mylog_& yyyymmddhhmmss..log"
>
>
>
> As you have done, in descending unit of measure order so
> that filenames will sort in directory listings as desired.
>
>
>
> Hope this is helpful.
>
>
> Mark Terjeson
> Investment Business Intelligence
> Investment Management & Research
> Russell Investments
> 206-505-2367
>
>
> Russell
> Global Leaders in Multi-Manager Investing
>
>
>
>
>
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Quentin McMullen
> Sent: Monday, February 20, 2012 8:47 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: altlog with timestamp
>
> Hi All,
>
> I'm trying to set up an automatically timestamped -altlog. Win XP.
>
> From the docs, it looks like it should be as easy as specifying:
> -altlog "C:\junk\mylog_%Y%M%D.log"
>
> during invocation. But I've tried putting that in the defintion for
> the SAS icon, and in my config file, and can't get the date directives
> to resolve. Can someone enlighten me?
>
> Kind Regards,
> --Quentin
|