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

By using the below code, I'm able to identify the current week number of the month. Thanks for the previous post by user: ballardw ( Posted 05-18-2017 07:23 PM )

data _null_;

    week = week(today()) - week((intnx('month',today(),0,'B'))) +1;

    call symputx('week',week);

run;

 

But I am facing difficulty, while running a report, which has to list the last week number......which means, if I am running a report now, it has to give me last week number, which is week4 (Here, I need to run a report that lists the data from last Monday to Saturday, i.e. 21st September to  27th September).

Any kind of help is greatly appreciated. Thanks

1 ACCEPTED SOLUTION
2 REPLIES 2

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

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