Good afternoon.
Thanks for any help someone could give me.
I have a dataset sorted descending by month/year. I am attempting to create a report with ODS Excel creating multiple tables on one worksheet. I would like the tables to be grouped by month/year and remain sorted descending. I don't want the user to have to scroll to the bottom to see the newest table. I attempted to use order and order = ?? but continue to get a message stating "Data set WORK.?? is not sorted in ascending sequence. The current BY group
has RECEIVED_MONTH = SEP21 and the next BY group has RECEIVED_MONTH = AUG21. I would like to keep the data in descending order if possible. ODS also creates several other worksheets in the same workbook although the dataset this proc report depends on is only used for this work sheet.
Thank you very much.
ods Excel options(sheet_interval = 'output'
sheet_name = '5+ Per Month'
suppress_bylines = 'yes'
orientation = 'landscape'
pages_fitwidth = '1'
pages_fitheight = '1'
absolute_column_width = '11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 20');
proc report data = report_wanted nowd
style(REPORT)={cellpadding=5 background=#D0C7A8}
style(COLUMN)={font_face=Arial font_size=1 background=white}
style(HEADER)={font_face=Arial font_size=1 font_weight=bold foreground=black background=#EBE8DA};
column received_month var1 var2 var3 var4 count;
define received_month / 'Recieved/Month' group noprint order order = data;
define location / 'var1';
define var2 / 'var2';
define var3 / 'var3';
define var4 / var4';
define count / 'Count';
by received_month;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.