BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hhchenfx
Rhodochrosite | Level 12

Hi Everyone,

I have a column with date and I want to create a new column for the same date in the next 3 month.

So '5MAY2022'd will have '5AUG2022'd and '5NOV2022' will have '5FEB2023'd.

Can you please help?

Thank you,

HHC

 

data have;
    format my_date date9.;
    input my_date date9.;
    datalines;
05MAY2022
05NOV2022
;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12
data want;
  set have;
  newdate=intnx('month',my_date,3,'s');
  format newdate date9.;
run;

View solution in original post

2 REPLIES 2
japelin
Rhodochrosite | Level 12
data want;
  set have;
  newdate=intnx('month',my_date,3,'s');
  format newdate date9.;
run;
hhchenfx
Rhodochrosite | Level 12

Thank you,

It works perfectly.

HHC

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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