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

I have the following data set like this : 

 

Group_NameHead_NameLastYear_CountBeforeLastYear_Count
R&DIT12
R&DTesting05
R&DProduction40
R&DDevelopment10
SalesBook54
SalesProduct100
SalesKit11
AdminMarketing41
AdminHR52
AdminProject63

 

and I want to get the output like the following attachment using proc report.:

 

1 ACCEPTED SOLUTION

Accepted Solutions
singhsahab
Lapis Lazuli | Level 10

HI,

 

data test;
input Group_Name $ Head_Name $	LastYear_Count	BeforeLastYear_Count;
cards;
R&D IT 1 2
R&D Testing 0 5
;
run;


proc report data=test style(header)=[background=white];
 col ('Groups ' Group_Name Head_Name)
 ('total count' LastYear_Count BeforeLastYear_Count );
run;

 

Thanks,

View solution in original post

1 REPLY 1
singhsahab
Lapis Lazuli | Level 10

HI,

 

data test;
input Group_Name $ Head_Name $	LastYear_Count	BeforeLastYear_Count;
cards;
R&D IT 1 2
R&D Testing 0 5
;
run;


proc report data=test style(header)=[background=white];
 col ('Groups ' Group_Name Head_Name)
 ('total count' LastYear_Count BeforeLastYear_Count );
run;

 

Thanks,

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 854 views
  • 1 like
  • 2 in conversation