BookmarkSubscribeRSS Feed
jwill731
Fluorite | Level 6

Hi Everyone,

 

Currently my date variable is in the format of mmyy (i.e. 01/2010)

 

I used the following code to read the data. While everything is read correctly, it automatically added first day of the month for each DOB (i.e. 01May1990).

 

data temp;
infile 'C:\users\';
informat DOB anydtdte.;
format DOB date9.;
input DOB
run;

 Is there a way to add the 15th day of the month instead?

 

For simplicity I left out all the other variables like gender, postal code etc from informat and input function.

 

Thanks in advance!! 

 

1 REPLY 1
Reeza
Super User

Add 14 to the variable. Variable = Variable + 14;

 

Use INTNX to set the value to mid month, check the documentation for options for last parameter which is alignment.

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1397 views
  • 0 likes
  • 2 in conversation