I have a Start date variable as a category and want to turn into a date. Have used RemoveChars to remove the strings but how to convert it to a proper date so it can be sorted correctly?
Start date | Want |
05/04/2021 (abc) | 5/04/2021 |
05/04/2021 (abc) | 5/04/2021 |
Thanks
It would be better to fix this before it is loaded into VA using the methods already given
Following method can be used to solve the issue :
date_n=input(substr(start_date,1,10),mmyydd10.);
format date_n date9.;
It would be better to fix this before it is loaded into VA using the methods already given
Data needs to be cleaned before it goes to VA. VA is for analytics, not for ETL.
And date values HAVE to be stored as such when data is imported into SAS.
A simpler method:
data want;
set have;
want_date = input(start_date, mmdyy10.);
format want_date mmddyys10.;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!