How do i set the first day of the week is Monday in SAS, and create a weekly report?

I'm currently working on creating a weekly report.  in SAS, the default first day of the week is Sunday, however, I want it to be Monday through Sunday, and then group the report weekly.  How should i do?
Who is Participating?
You need to create a new variable, which is the Saturday before the date in question. To do this, use intnx, but with 'week.7' as the 1st argument. Note - the number is the number of days after Saturday, so 1=Sunday, 2=Monday etc. e.g.:

data tst;
  format DATEVAR WEEKVAR date9.;
  do DATEVAR='18Oct2007'd, '19Oct2007'd, '20Oct2007'd, '21Oct2007'd, '22Oct2007'd, '23Oct2007'd;
    WEEKVAR = intnx('week.7',DATEVAR,0);

proc print data=tst;
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.