Where to place option?

Frequent Contributor
Posts: 76

Where to place option?


i am new to SAS.

I am confused about where to place the options in a PROC.

In Eg 1, the order option is placed at the start of the program whereas in Eg 2 it is placed in the CLASS statement.

Is there some general rules?

Thank you

Eg 1:

proc freq data=test order=formatted;

Eg 2:



Super Contributor
Posts: 644

Re: Where to place option?

You are right to detect a certain amount of inconsistency in SAS statements.  Part of the reason is the prehistory of the pieces that are assembled in SAS today.  In the case of Tabulate, the structure of the proc is based on a piece of software called TPL, which was very popular on mainframes about 30 years ago.  SAS eventually bought TPL, mainly as a service to legacy users.

Another example is Proc Transpose, which started life as a SAS user contribution, over time taken into the official code base.

The inconsistency I most dislike is between translate() and tranwrd().

Moral, if you want one, SAS has excellent documentation and there is no shame in looking up the syntax until you are familiar with the procedure.

Richard (currently in NZ)

Super User
Posts: 13,508

Re: Where to place option?

Tabulate allows for different orders so you can control your desired appearance.

Order=formatted on the proc statement says to order any class variables not specifically stated to use a different ordering should use formatted. But you can override that for selected class variables such as in your second example.

If you generate different code in different versions of EG you may be going through menues differently.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation