I am new to using PROC REPORT and do not fully understand how the sorting works. My code is as follows (substituted with dummy variables):
proc report data = working nowd split = '*'
%reportStyle;
column VAR TIME _STAT_ CAT1 CAT2 CAT3;
define VAR / order 'Variable' order = data style(column) = [just = left cellwidth = 0.7in];
define TIME / order 'Subvariable' order = data style(column) =...;
define _STAT_ / display 'Statistics' format = stat. style(column) = ...;
define CAT1 / display 'CAT1' ...;
define CAT2 / display 'CAT2' ...;
define CAT3 / display 'CAT3' ...;
compute after;
line "Footnote";
endcomp;
run;
I want it to first sort by Subvariable and then by Variable, while maintaining my desired order of columns.
Thank you in advance.
Introduce an extra copy of the second column as a hidden zero-th column to sort by.
proc report data=sashelp.class ;
column sex=extra name sex age ;
define extra / order noprint;
define name / order ;
define sex / order;
define age / display;
run;
Introduce an extra copy of the second column as a hidden zero-th column to sort by.
proc report data=sashelp.class ;
column sex=extra name sex age ;
define extra / order noprint;
define name / order ;
define sex / order;
define age / display;
run;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.