I have spent hours on this and i am still struggling to figure out the issue
For some reason SAS doesn't recognise the comparison "if date>=31/01/98" even though i have already formatted date variable. The outcome for variable test is always 1 even for dates prior to 31/01/98
Any help would be appreciated ?
data b;
informat date anydtdte12.;
set a;
format date ddmmyy8.;
run;
data c;
set b;
if date>=31/01/98 then test = 1;else test=0;
run;
Obs |
date |
test |
1 |
31/01/1997 |
1 |
2 |
28/02/1997 |
1 |
3 |
31/03/1997 |
1 |
4 |
30/04/1997 |
1 |
5 |
31/05/1997 |
1 |
6 |
30/06/1997 |
1 |
7 |
31/07/1997 |
1 |
8 |
31/08/1997 |
1 |
9 |
30/09/1997 |
1 |
10 |
31/10/1997 |
1 |
11 |
30/11/1997 |
1 |
12 |
31/12/1997 |
1 |
13 |
31/01/1998 |
1 |
14 |
28/02/1998 |
1 |
15 |
31/03/1998 |
1 |
16 |
30/04/1998 |
1 |
17 |
31/05/1998 |
1 |
18 |
30/06/1998 |
1 |
19 |
31/07/1998 |
1 |
20 |
31/08/1998 |
1 |
21 |
30/09/1998 |
1 |
22 |
31/10/1998 |
1 |
23 |
30/11/1998 |
1 |
24 |
31/12/1998 |
1 |
25 |
31/01/1999 |
1 |