BookmarkSubscribeRSS Feed
yesidgranadosv
Obsidian | Level 7
Good afternoon I would like to have a SAS function that gives me the result and change the year now

 

20190101

20200101

next year

 
 

data _null_;
call symputx('Fetch_FIN', put(intnx ('month',today(),0, 'b') + 1 ,yymmddn8.) );
run;

%put Fetch_FIN = &Fetch_FIN.;

 

 
3 REPLIES 3
Tom
Super User Tom
Super User

Please clarify what you are trying to do. 

Your text talks about YEAR but your code is using MONTH intervals instead or YEAR intervals.

PaigeMiller
Diamond | Level 26

Please clarify what you are trying to do

 

Having a macro variable with value 20190101 is rarely useful.

--
Paige Miller
Patrick
Opal | Level 21

@yesidgranadosv 

I don't fully understand what you're asking for. May be below is enough to give you the pointers you need.

data _null_;
  do i=-3 to 3;
    dt=intnx('year',today(),i,'b');
    put dt yymmddn8.;
  end;
  stop;
run;

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

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
  • 3 replies
  • 861 views
  • 0 likes
  • 4 in conversation