BookmarkSubscribeRSS Feed
anilgvdbm
Quartz | Level 8

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

3 REPLIES 3
LinusH
Tourmaline | Level 20

Can't see the problem in your attached dates, they are all in date format. So just input them...?

Data never sleeps
Imroze
Fluorite | Level 6

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;

pradeepalankar
Obsidian | Level 7

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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

How to choose a machine learning algorithm

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.

Discussion stats
  • 3 replies
  • 1710 views
  • 0 likes
  • 4 in conversation