11-13-2013 01:46 AM
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?
proc freq data=test order=formatted;
PROC TABULATE DATA=test MISSING;
CLASS Sale_TYPE/ORDER=DATA PRELOADFMT;
11-13-2013 02:31 AM
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)
11-13-2013 04:35 PM
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.