01-01-2013 11:03 PM
I have a data set to clean up.
I need to delete rows with dates that end with 00-10
the date column looks like this:
01-02-2013 12:42 AM
assuming you want to delete date end with '00' and '10':
if substr(date,length(date)-1) in ('00','10') then delete;
01-07-2013 03:05 PM
Please take a look at the example below:
input var $;
/* we could combine the above four lines as:*/
Obs var n from to new1 new2
1 adb 3 2 2 db db
2 bbcd 4 3 2 cd cd
3 bdscv 5 4 2 cv cv
4 1234567 7 6 2 67 67
01-02-2013 12:59 PM
The data you have listed do not look like dates. They look like they might be dates in YYYYMMDD format but with an additional two digits appended.
If you did have dates like 19990101 and wanted to delete dates with the day value between 1 and 10 then you could use the DAY() function.
if 1 <= day(DATEVAR) <= 10 then delete.
If you have read this value as a number (that is 1999010101 has been read as the number 1,999,010,101) then look at using the MOD() function to find the two least significant digits.
if 1 <= mod(DATELIKEVAR,100) <= 10 then delete;