Where to place option?

Reply
Frequent Contributor
Posts: 75

Where to place option?

Hi

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:


PROC TABULATE DATA=test MISSING;

CLASS Sale_TYPE/ORDER=DATA PRELOADFMT;

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: 11,343

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
  • 169 views
  • 0 likes
  • 3 in conversation