Dear All,
here is the problem regarding date format. the date variable is in character format and some values are in numbers and some values are in date format.
so how do i convert all in to one format.
i attached the data for your reference.
Date of Interview |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
30/06/1990 |
30/06/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
8/1/1990 |
28/03/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
9/1/1990 |
30/06/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
12/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
30/06/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
8/1/1990 |
8/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
30/06/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
30/06/1990 |
30/06/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
8/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
10/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
1/7/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
11/1/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
30/06/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
12/1/1990 |
30/06/1990 |
30/06/1990 |
Can't see the problem in your attached dates, they are all in date format. So just input them...?
Hope the below code works..
data _null_;
set date;
new_date=input(date,yymmdd10.);
if not missing(new_date) then
final_date=new_date;
else
final_date=date;
put final_date=;
run;
data test;
input date_of_interview :$10.;
format final_date_of_interview date9.;
final_date_of_interview=input(date_of_interview,ddmmyy10.);
cards;
30/06/1990
30/06/1990
30/06/1990
30/06/1990
30/06/1990
30/06/1990
30/06/1990
30/06/1990
9/1/1990
9/1/1990
9/1/1990
9/1/1990
9/1/1990
9/1/1990
9/1/1990
9/1/1990
9/1/1990
9/1/1990
;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.