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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 525 views
  • 0 likes
  • 4 in conversation