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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.