Hi,
I would like to put my output from my summary table in a specific order.
I created the summary and then output the results to a work file, so I can reorder it. Now it is ordering in alpabetical order.
One way I thought of is to create a calculated value based on the row, and then another calculated value with a case to assign my row number to sort--
Anyone have a function for row? Monotonic() returns odd results when I try to add to it!
In the example attached, I would like Category 3 to be moved to the bottom of the report after Category 2.
Any ideas? Thanks in advance.
Jo
I heeded the warning about monotonic!
I tried going into the code and changing the order statements in the PROC Tabulate.
But what ultimately worked was simply padding the category that I wanted first with 3 blanks, next category 2 blanks, etc.
Worked!
Be careful about using monotonic, or trying to do this in SQL. SQL is an inherently set-oriented language, and doesn't do "do this line before this line" types of operations well.
In your case, it looks to me like you could assign numeric values for your categories in whatever order you want, and then use formats to create the nicely labelled output.
Tom
I heeded the warning about monotonic!
I tried going into the code and changing the order statements in the PROC Tabulate.
But what ultimately worked was simply padding the category that I wanted first with 3 blanks, next category 2 blanks, etc.
Worked!
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.