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

Hello,

 

I want to put the week number into a macro variable ex:

 

%let today=%sysfunc(today());

%let week=%???? week(&today, 'v');

%put &week gives 2...

 

any suggestion?

 

Regards,

Alain 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Macro language won't need quotes around "v" so the middle statement becomes:

 

%let week = %sysfunc(week(&today, v));

View solution in original post

1 REPLY 1
Astounding
PROC Star

Macro language won't need quotes around "v" so the middle statement becomes:

 

%let week = %sysfunc(week(&today, v));

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 857 views
  • 0 likes
  • 2 in conversation