Date: Wed, 5 Sep 2007 12:48:00 -0400
Reply-To: Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject: Re: %sysfunc and date format
On Wed, 5 Sep 2007 09:13:42 -0700, a@MAILINATOR.COM wrote:
>this works but not in the proc sql
>
>%let a=%sysfunc(putn(%sysfunc(date()) -16, yymmdd10.));
>%let b=%sysfunc(translate(%sysfunc(putn(%sysfunc(date()) -16,
>yymmdd10.)),"/","-"));
>%put &a &b;
>
>2007-08-20 2007/08/20
>
>..and date =
> ("%sysfunc(translate(%sysfunc(putn(%sysfunc(date()) -16,
>yymmdd10.)),"/","-"))")
>
>produces error in sas log
>
>Column '2007/08/20' not found
hi,
with my 9.1.3 sp4 on my win xp, i get an error doing below, too. It seems
that proc sql has trouble with some macro quoted strings. Explicitly
unquoting works. HTH.
Cheers,
Chang
%let today = (%str(%')%sysfunc(date(), yymmdds10.)%str(%'));
/* bunch of errors */
proc sql;
select *
from sashelp.class
where '2007/01/01' < &today.;
quit;
/* this works fine */
proc sql;
select *
from sashelp.class
where '2007/01/01' < %unquote(&today.);
quit;
|