Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Regarding date format

Reply
Contributor
Posts: 59

Regarding date format

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

Super User
Posts: 5,426

Re: Regarding date format

Posted in reply to anilgvdbm

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

Data never sleeps
Contributor
Posts: 62

Re: Regarding date format

Posted in reply to anilgvdbm

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;

Frequent Contributor
Posts: 106

Re: Regarding date format

Posted in reply to anilgvdbm

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;

Ask a Question
Discussion stats
  • 3 replies
  • 399 views
  • 0 likes
  • 4 in conversation