BookmarkSubscribeRSS Feed
Petersi
Calcite | Level 5
Can PROC REPORT perform a transpose of the output? I only have 3 rows but many columns, and the end user wants the rows to appear as columns. In order to do this, I am creating an output dataset from PROC REPORT, transposing that with PROC TRANSPOSE and then running a second PROC REPORT to display the summarized data as requested. This is a quick solution, but it does not work very well for a number of reasons, such as differing number formats on the same column in the second report. There must be a simpler way.
1 REPLY 1
deleted_user
Not applicable
On the face of it - did you try defining each variable as an across variable?

Something like:

PROC REPORT DATA=WORK.HOLIDAYS LS=142 PS=46 SPLIT="/" CENTER NOWD;
COLUMN Holiday Agency_Status Date;

DEFINE Holiday / ACROSS FORMAT= $22. WIDTH=22 SPACING=2 LEFT "Holiday" ;
DEFINE Agency_Status / ACROSS FORMAT= $22. WIDTH=22 SPACING=2 LEFT "Agency_Status" ;
DEFINE Date / ACROSS FORMAT= DATE9. WIDTH=9 SPACING=2 RIGHT "Date" ;
RUN;

I went back a added a quick demo from something I had.


Message was edited by: rwright Ignore me - I completely mis-read what you were trying to do.

This might be better done using COMPUTAB (if you have access to it).


Message was edited by: rwright

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 2019 views
  • 0 likes
  • 2 in conversation