BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
marianhabesland
Calcite | Level 5

Screen Shot 2017-10-10 at 16.54.53.png

 

I am trying to create a function that creates a numeric variable called BirthDt that basically combines the BirthYear, BirthMonth and BirthDay into one numerical variable, ie so the BirthDt for the first observation would be 199. I am struggling with which function to actually use for this. Any advice?

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

MDY is the one to use here:

 

BirthDate = mdy(BirthMonth, BirthDay, BirthYear);
format BirthDate date9.;

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

MDY is the one to use here:

 

BirthDate = mdy(BirthMonth, BirthDay, BirthYear);
format BirthDate date9.;
marianhabesland
Calcite | Level 5

Thanks! That worked perfectly. There are so many date functions, I was struggling finding one to use.

SASKiwi
PROC Star

Good to hear. You are right, there are a lot of date functions and it can be hard to find a suitable one.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2005 views
  • 0 likes
  • 2 in conversation