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,
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.