BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jeff_DOC
Pyrite | Level 9

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
by descending received_month;

FYI - By in SORT should be same in PROC SORT to help with that.

View solution in original post

1 REPLY 1
Reeza
Super User
by descending received_month;

FYI - By in SORT should be same in PROC SORT to help with that.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 314 views
  • 0 likes
  • 2 in conversation