When we export SAS dataset to excel, we mostly do not like the actual variable name as column name in excel. Alternatively, variable label is more popular.
To export the label before SAS 9.2, we have to use LIBNAME with excel engine since it have many fine options to tune the output, e.g. DBLABEL, DBTYPE etc.
However, when the sheet is existing at that time, they can not be replaced automatically. That means you have to clean the file in advance.
In SAS 9.2, a new options is introduced: LABEL option in PROC EXPORT. The new option allow the output excel take label. Furthermore, PROC EXPORT support REPLACE functionality, that means we may avoid the code to clean the file.
Showing posts with label option. Show all posts
Showing posts with label option. Show all posts
Sunday, March 14, 2010
Tuesday, August 18, 2009
Are you missing "missing option"?
Generally, SAS do not take missing value as a valid value, especially for class variable. That means there will be an implicit filter to delete all "missing" class, e.g. the class variable in Proc MEANS, PROC FREQ.
Likewise, missing values is not valid value for any group, order or across variable in Proc REPORT.
Likewise, missing values is not valid value for any group, order or across variable in Proc REPORT.
Friday, December 12, 2008
USER system option for batch mode debug
We run SAS program in two mode: batch mode and interactive mode (DMS/NODMS).
With batch mode, I can automate and schedule the SAS job. This can improve the work efficiency dramatically.
However, when SAS job fail, it will take more time to solve the issue.
Below are the steps:
1. With system option USER, run the file and save WORK datasets in permanent libary.
2. Check the error point in SAS log.
3. Start from error point, debug the code step by step.
With batch mode, I can automate and schedule the SAS job. This can improve the work efficiency dramatically.
However, when SAS job fail, it will take more time to solve the issue.
Below are the steps:
1. With system option USER, run the file and save WORK datasets in permanent libary.
2. Check the error point in SAS log.
3. Start from error point, debug the code step by step.
Tuesday, December 2, 2008
What a pity: there are no COMPLETETYPES, PRELOADFMT and MLF options for Proc FREQ
The most widely used Procs for simple statistics are Proc Freq and Proc Means. One is for categorical variable while the other for numerical variable.
Although Proc Means can do some part work of Proc Freq, it can not replace Proc Freq completely.
When the 3 options (COMPLETETYPES, PRELOADFMT and MLF) are combined with user-defined format, Procs are SO powerful in tabulate output. Definitely, it will simplify many post-processing.
The three options are only partly specific to Proc Means, Proc Report and Proc Tabulate.
And, they are not available to Proc Freq. That means we have to play a trick when counting frequency of categorical variable by using Proc Freq.
What a pity!
Although Proc Means can do some part work of Proc Freq, it can not replace Proc Freq completely.
When the 3 options (COMPLETETYPES, PRELOADFMT and MLF) are combined with user-defined format, Procs are SO powerful in tabulate output. Definitely, it will simplify many post-processing.
The three options are only partly specific to Proc Means, Proc Report and Proc Tabulate.
And, they are not available to Proc Freq. That means we have to play a trick when counting frequency of categorical variable by using Proc Freq.
What a pity!
Subscribe to:
Posts (Atom)