Greetings,
Is it possible, using PROC REPORT (SAS v9.4), to mimic the capabilities of PROC TABULATE with regard to indenting nested rows underneath parent rows instead of placing them next to each other?
For example, I have data that produces output similar to below:
---------------------------
| |Gender |
| |-------|
|EDLVL OFFICE | F | M |
|-----------------+---+---|
|Bac Accounting| 4| 2|
| Admin | 2| 3|
| Systems | 4| 4|
|Mas Accounting| 2| 2|
| Admin | 1| 0|
| Systems | 3| 4|
|PhD Systems | 0| 1|
---------------------------
in PROC TABULATE, I can use NOSEPS and INDENT= options to make the above output look like the following:
----------------------
| |Gender |
| |-------|
| | F | M |
|------------+---+---|
|Bac | |
| Accounting| 4| 2|
| Admin | 2| 3|
| Systems | 4| 4|
|Mas | |
| Accounting| 2| 2|
| Admin | 1| 0|
| Systems | 3| 4|
|PhD | |
| Systems | 0| 1|
----------------------
Although I am not very savvy in PROC REPORT, I want to use that tool because there is so much more to my product than what's seen here. Does PROC REPORT have the capability to do this?
Any help would be greatly appreciated.
Thank you
Rod
What is your ODS Destination ?
data class;
set sashelp.class;
select(age);
when(11,12) group='xxxxx';
when(14,15,16) group='yyyyy';
otherwise group='zzzzz';
end;
run;
proc report data=class nowd;
column group name age,sex;
define group/group noprint;
define name/display style={pretext=' ' asis=on};
define sex/across;
define age/analysis ' ';
compute before group/style(lines)={just=left fontweight=bold};
line group $40.;
endcomp;
run;
Yes this is possible in PROC REPORT. You do this by creating a COMPUTED column which is defined by a series of REPORT programming statements. It requires some advanced techniques so its a lot easier to follow from an example. I've seen something like this in SAS Support so I'll try to find an example for you.
What is your ODS Destination ?
data class;
set sashelp.class;
select(age);
when(11,12) group='xxxxx';
when(14,15,16) group='yyyyy';
otherwise group='zzzzz';
end;
run;
proc report data=class nowd;
column group name age,sex;
define group/group noprint;
define name/display style={pretext=' ' asis=on};
define sex/across;
define age/analysis ' ';
compute before group/style(lines)={just=left fontweight=bold};
line group $40.;
endcomp;
run;
This worked very well. Thank you for helping...I very much appreciate it.
My ODS destination is Powerpoint.
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.