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

I have a dataset with variables DAYM1-DAYM31 for counts for each day of the month and DAYW1-DAYW7 for counts for each day of the week.   It's easy to put column headers on these, but I would like to put a head _above_ the DAYM1-DAYM31 headers to say 'Day of Month' and above the others to say 'Day of Week' ...  in PROC REPORT, how do I put that sort of heading? Do I need to create some sort of dummy variable?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

This is a particularly poor arrangement of the data for this purpose. If DAYM1-DAYM31 were not columns in your dataset, but there was a row for each day of the month, then the process is extremely simple. You would use the ACROSS option in the DEFINE statement of PROC REPORT.

 

define day/across "Day of Month";

Since you don't have this, then try

 

columns variable1 ("Day of Month" daym1-daym31);

  There are many other advantages to not putting actual information (the day of the month) into your variable names.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

This is a particularly poor arrangement of the data for this purpose. If DAYM1-DAYM31 were not columns in your dataset, but there was a row for each day of the month, then the process is extremely simple. You would use the ACROSS option in the DEFINE statement of PROC REPORT.

 

define day/across "Day of Month";

Since you don't have this, then try

 

columns variable1 ("Day of Month" daym1-daym31);

  There are many other advantages to not putting actual information (the day of the month) into your variable names.

--
Paige Miller
TimH
Quartz | Level 8

Thanks - I found this right after I posted.   I must not have been searching using the right terms. In any case, it works!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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