|
Whoever you are;
Why are you bothering with character representations of dates? SAS has
an acceptable method of dealing with date; it's a number that represents the
days since Jan 1, 1960. You might change your code to the following:
1 %let startDate = "02Feb1999"d ;
2 %let endDate = "01Jan2000"d ;
3 Data _null_ ;
4 sDate = "30Apr1999"d ;
5 If ( &startdate <= sdate <= &enddate ) then put "It worked!" ;
6 Run ;
It worked!
Now, to your code. The only explanation I can guess at given the brevity of
your description of the problem is that some of your character dates are not
convertable by YYMMDD8.
Ed
Ed Heaton
#4818
TA-2018
-----Original Message-----
From: N Yiannakoulias [mailto:nwy@SRV.UALBERTA.CA]
Sent: Tuesday, February 05, 2002 2:47 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Dates again
Always probems with dates...
Inside a macro I define two values like this:
%LET startdate="19990202";
%LET enddate="20000101";
then later on, in a data step, I want to use these dates:
[...]
1. sdate=input(dates,yymmdd8.);
2. IF input(&startdate,yymmdd8.) <= sdate <= input(&enddate,yymmdd8.) THEN
OUTPUT p1_1;
[...]
But SAS is unhappy with the input arguments in line 2. I have no clue
what's wrong with this
probably simple task. Can you help?
N
--
-----------------------------------------------
Conveniently located at lat 53 31'.01, lon 113 30'.26
|