Is there something to get the date range from the beginning of the year to the end of the most recently week like there is for a year-to-date monthly or quarterly date range?
options sysparm ="parmmaker=20000101~ytd_qtr~1~1,file_sfx=_test,run_as_test=Y";
or
options sysparm='parmmaker=20000101~ytd_mon~0~0,file_sfx=test,client=SHELLOIL';
Thanks
@PeterClemmensen wrote:
You can obtain the two date value like this. Not sure how this relates to you options sysparm statements though 🙂
data _null_; YearStart=intnx('year', today(), 0, 'b'); RecentWeekEnd=intnx('week.2', today(), 0, 'b')-1; put YearStart date9. // RecentWeekEnd date9.; run;
Thanks. I know how to do it that way. I think it must be a function that is internal to our company that someone wrote. We have a macro that generates a variety of dates and date formats based on the sysparm. I think there is something that is internal to that function that generates the date range that I want when it sees "ytd_mon" or "ytd_qtr". I look in there to see if there is one for weekly too.
Thanks again.
Do you want all these dates in a data set or simply the two dates?
@PeterClemmensen wrote:
Do you want all these dates in a data set or simply the two dates?
Just the begin and end dates. I'm wondering if this is something that was done internally and is not a SAS function. Thanks for the quick reply.
You can obtain the two date value like this. Not sure how this relates to you options sysparm statements though 🙂
data _null_;
YearStart=intnx('year', today(), 0, 'b');
RecentWeekEnd=intnx('week.2', today(), 0, 'b')-1;
put YearStart date9. // RecentWeekEnd date9.;
run;
@PeterClemmensen wrote:
You can obtain the two date value like this. Not sure how this relates to you options sysparm statements though 🙂
data _null_; YearStart=intnx('year', today(), 0, 'b'); RecentWeekEnd=intnx('week.2', today(), 0, 'b')-1; put YearStart date9. // RecentWeekEnd date9.; run;
Thanks. I know how to do it that way. I think it must be a function that is internal to our company that someone wrote. We have a macro that generates a variety of dates and date formats based on the sysparm. I think there is something that is internal to that function that generates the date range that I want when it sees "ytd_mon" or "ytd_qtr". I look in there to see if there is one for weekly too.
Thanks again.
What is your actual question?
SYSPARM is a generic option to the user pass in text on the command line when stating SAS.
How the program that you wrote is using that string you will need to tell us.
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!
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.