Efficiency and performance strategies for SAS can classified into five stages:
1. CPU time 2. Data Storage 3.Elapsed time 4. I/O 5. Memory
1. CPU Time
A. Use Keep= and Drop= data set options to retain desired variable.
B. Create and use indexes with large data sets.
C. Utilize macro for redundant code.
D. Use IF/Then - else statement to process data.
E. Use the data sets procedure copy statement to copy data sets with indexes.
F. Use SQL procedures to consolidate the number of steps.
G. Turn off macro facility when not needed.
H. Avoid unnecessary sorting - Plan for its use.
I. Use procedures that support CLASS statement.
J. Use the stored program facility for complex data steps.
2. Data Storage
A. Use Length statements to reduce variable size.
B. Create character variable as much as possible.
C. Use _Null_ steps for processing null data sets.
3. I/O
A. Read only data, that is needed.
B. Use "Where" Statements to subset data.
C. Use data compression for large data set.
D. Store data in SAS Data sets, not external files.
E. Perform data subsets early and at same time.
4. Programming time (Elapsed time)
A. Use procedures whenever possible.
B. Document programs and routines with comments.
C. Code for unknown data values.
D. Assign descriptive and meaningful variable names
1. CPU time 2. Data Storage 3.Elapsed time 4. I/O 5. Memory
1. CPU Time
A. Use Keep= and Drop= data set options to retain desired variable.
B. Create and use indexes with large data sets.
C. Utilize macro for redundant code.
D. Use IF/Then - else statement to process data.
E. Use the data sets procedure copy statement to copy data sets with indexes.
F. Use SQL procedures to consolidate the number of steps.
G. Turn off macro facility when not needed.
H. Avoid unnecessary sorting - Plan for its use.
I. Use procedures that support CLASS statement.
J. Use the stored program facility for complex data steps.
2. Data Storage
A. Use Length statements to reduce variable size.
B. Create character variable as much as possible.
C. Use _Null_ steps for processing null data sets.
3. I/O
A. Read only data, that is needed.
B. Use "Where" Statements to subset data.
C. Use data compression for large data set.
D. Store data in SAS Data sets, not external files.
E. Perform data subsets early and at same time.
4. Programming time (Elapsed time)
A. Use procedures whenever possible.
B. Document programs and routines with comments.
C. Code for unknown data values.
D. Assign descriptive and meaningful variable names
- For memory go with some options like sort size, buff size, mem size and Real Mem Size........
No comments:
Post a Comment