BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

%let enddate=%sysfunc(today());
%let startdate=%eval(%sysfunc(today())-12);
%let enddate2=%sysfunc(today(),yymmddn8.);
%let startdate2=%eval(%sysfunc(today())-12);/* would like to convert 22512 into 20210820*/
%put &=startdate. &=enddate. &=enddate2 &=startdate2;

1 ACCEPTED SOLUTION
2 REPLIES 2
ballardw
Super User

@alepage wrote:

%let enddate=%sysfunc(today());
%let startdate=%eval(%sysfunc(today())-12);
%let enddate2=%sysfunc(today(),yymmddn8.);
%let startdate2=%eval(%sysfunc(today())-12);/* would like to convert 22512 into 20210820*/
%put &=startdate. &=enddate. &=enddate2 &=startdate2;


If you are not using these variables in something a person reads, such as title in a report, you are much better off leaving these as the simple numeric values for use in calculations or comparisons.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 485 views
  • 1 like
  • 3 in conversation