Order the Headings

Overview

So far we have relabeled headings, deleted headings, and changed the width of headings. But what if you have the right headings, but you do not like the order in which they appear? You can change the order of two variables by reversing their order in the TABLE statement. But if your headings represent the values of a class variable, you cannot list them specifically in the TABLE statement.
To control the order in which the values of a class variable appear in the row or column headings, you need to use the ORDER= option. This option is used in the PROC TABULATE statement. The four settings for this option, UNFORMATTED, FORMATTED, DATA, and FREQ, are shown in the following examples.

Using ORDER=FORMATTED

The default ...

Get PROC TABULATE by Example, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.