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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!