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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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