Hello.
I am trying to create a single table with the same formatting as the id + by statement tables, where the id values are not repeated. For example
I want this to all be one table, not 2.
How do I do this?
One quick way is to switch to PROC REPORT and specify the BY variable as a GROUP variable instead. You can also try specifying the ID variable the same as the BY variable and see if that resolves it as in this example: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1dex816rlsynxn1gicri1elan89.htm#n1dex81...
EDIT:
proc sort data=sashelp.class out=class;
by sex;
run;
title 'PROC PRINT + BY';
proc print data=class;
by sex;
run;
title 'PROC PRINT + BY + ID';
proc print data=class;
id sex;
by sex;
run;
title 'PROC REPORT + GROUP';
proc report data=class;
column sex name age weight height;
define sex / group ;
define name / display;
define age / display;
define weight / display;
define height / display;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.