DATA Step, Macro, Functions and more

Creating DOB variable when I have Month, Day, Year as separate variables

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 10
Accepted Solution

Creating DOB variable when I have Month, Day, Year as separate variables

So the dataset I am working on has an infants DOB listed across three variables

I have a variable for Month, Day, and Year.

I need to combine them into a single DOB variable, but the data I'm finding for combining variables isn't helping so far.

 

Sorry, new to SAS and some of this hasn't sunk in yet.


Accepted Solutions
Solution
‎04-17-2018 01:53 PM
Super User
Posts: 24,028

Re: Creating DOB variable when I have Month, Day, Year as separate variables

Posted in reply to DanielQuay

There's the MDY() function which returns a SAS Date.

 


@DanielQuay wrote:

So the dataset I am working on has an infants DOB listed across three variables

I have a variable for Month, Day, and Year.

I need to combine them into a single DOB variable, but the data I'm finding for combining variables isn't helping so far.

 

Sorry, new to SAS and some of this hasn't sunk in yet.


 

 

View solution in original post


All Replies
Solution
‎04-17-2018 01:53 PM
Super User
Posts: 24,028

Re: Creating DOB variable when I have Month, Day, Year as separate variables

Posted in reply to DanielQuay

There's the MDY() function which returns a SAS Date.

 


@DanielQuay wrote:

So the dataset I am working on has an infants DOB listed across three variables

I have a variable for Month, Day, and Year.

I need to combine them into a single DOB variable, but the data I'm finding for combining variables isn't helping so far.

 

Sorry, new to SAS and some of this hasn't sunk in yet.


 

 

Occasional Contributor
Posts: 10

Re: Creating DOB variable when I have Month, Day, Year as separate variables

That was it, thanks, I'll try to stay off the boards for a few hours now.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 112 views
  • 0 likes
  • 2 in conversation