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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1470 views
  • 0 likes
  • 2 in conversation