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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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