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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 742 views
  • 0 likes
  • 2 in conversation