Help using Base SAS procedures

How to combine three columns to one date variable?

Reply
Occasional Contributor
Posts: 6

How to combine three columns to one date variable?

Hi,

In my data I have three variables - year, month and day that I want to combine into one date variable with the format ddmmyy8.

How can I do that?

Thanks - Bodil
Occasional Contributor
Posts: 14

Re: How to combine three columns to one date variable?

use mdy function.

data test;
input month day year;
format new ddmmyy8.;
new=mdy(month,day,year);
datalines;
10 22 2010
10 23 2010
10 24 2010
;
run;
Occasional Contributor
Posts: 6

Re: How to combine three columns to one date variable?

I knew that a very easy solution was there somewhere... Thanks!
Ask a Question
Discussion stats
  • 2 replies
  • 182 views
  • 0 likes
  • 2 in conversation