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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1532 views
  • 0 likes
  • 2 in conversation