BookmarkSubscribeRSS Feed
sfffdg
Obsidian | Level 7

Hi ,

 

Just wondering if there is a way to achieve below using month6 interval.Basically trying other ways ..

 

data _null_;
date1=intnx('month','05may2022'd,6);
date2=intnx('month','05may2022'd,0);
days=date1-date2;
format date1 date2 date9.;
put date1 date2 days;
run;

 

Thanks,

Swathi

1 REPLY 1
Quentin
Super User

Not quite sure what you want, but you may be interested in exploring the optional alignment argument.  e.g.:

61   data _null_;
62   date1=intnx('month6','05may2022'd,1,'s');
63   date2=intnx('month6','05may2022'd,0,'s');
64   days=date1-date2;
65   format date1 date2 date9.;
66   put date1 date2 days;
67   run;

05NOV2022 05MAY2022 184

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