I have the following data set like this :
| Group_Name | Head_Name | LastYear_Count | BeforeLastYear_Count |
| R&D | IT | 1 | 2 |
| R&D | Testing | 0 | 5 |
| R&D | Production | 4 | 0 |
| R&D | Development | 1 | 0 |
| Sales | Book | 5 | 4 |
| Sales | Product | 10 | 0 |
| Sales | Kit | 1 | 1 |
| Admin | Marketing | 4 | 1 |
| Admin | HR | 5 | 2 |
| Admin | Project | 6 | 3 |
and I want to get the output like the following attachment using proc report.:
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,
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,
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.