BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Zatere
Quartz | Level 8

Hello there,

 

I want to merge two columns so that they are shown as one when using PROC REPORT.

 

 

data have;
   input condition $ Today Yesterday Diff;
   datalines;
AAA 18 17 1
BBB 3524 3541 -17
CCC 773 781 -8
DDD 1721 1721 0
EEE 26 26 0
FFF 5 3 2
;
run;


PROC REPORT DATA=have;	
COLUMN condition Today ('Yesterday' Yesterday Diff);
run;

 

 

The output of the above is:

 

Zatere_0-1607506204568.png

 

What I want is:

 

Zatere_1-1607506313329.png

Any ideas please?

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Define the columns without labels, and create "super-labels" for all:

PROC REPORT DATA=have;	
COLUMN ("Condition" condition) ("Today" Today) ('Yesterday' Yesterday Diff);
define condition / "" display;
define today / "" display;
define yesterday / "" display;
define diff / "" display;
run;

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

Define the columns without labels, and create "super-labels" for all:

PROC REPORT DATA=have;	
COLUMN ("Condition" condition) ("Today" Today) ('Yesterday' Yesterday Diff);
define condition / "" display;
define today / "" display;
define yesterday / "" display;
define diff / "" display;
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 531 views
  • 2 likes
  • 2 in conversation