Wednesday, June 25, 2014

Proc Rank -- Grading, Scoring, Ranking , Marketing Segmentation

1. Using PROC RANK and PROC UNIVARIATE to Rank or Decile Variables
http://www.nesug.org/Proceedings/nesug09/ap/ap01.pdf

Monday, June 23, 2014

Sampling data

1. Random Sample Selection
http://analytics.ncsu.edu/sesug/2000/p-404.pdf


2.Selecting Unrestricted and Simple Random With Replacement Samples Using Base SAS and PROC SURVEYSELECT
http://support.sas.com/resources/papers/proceedings12/347-2012.pdf

3. Strata Sampling: built _NSIZE_ dataset
http://support.sas.com/resources/papers/proceedings09/058-2009.pdf

Sunday, June 22, 2014

SAS Performance Issues, Indexes

1. Troubleshoot Your Performance Issues
http://support.sas.com/resources/papers/proceedings09/333-2009.pdf


2. Peeking into Windows to  Improve your SAS  Performance
http://www.scsug.org/SCSUGProceedings/2011/mpwelch1/Peeking%20into%20Windows%20to%20Improve%20Performance.pdf

3. Creating and Exploiting SAS  Indexes
http://www2.sas.com/proceedings/sugi29/123-29.pdf

4. Power Indexing: A Guide to Using Indexes Effectively in Nashville Releases
http://www2.sas.com/proceedings/sugi25/25/dw/25p124.pdf

# Pros and Cons of Index
The Law of Conservation of Energy states that energy is neither lost nor gained, but simply changes from one form to another.

The same is true with indexes; some resources are consumed at the expense of others. The use of indexes is a balancing act deciding what additional resources you can give up in order to get the performance benefits. CPU usage, I/O, memory and disk space are all affected when using indexes.

Consider how sequential access and index (direct) access work to find an observation. With sequential access, the SAS System reads a page from disk into memory. All of the observations on that page are processed. This reading and processing continues until the end of the file. With an index, the SAS System
determines the location of the next observation using the index, reads a new page if necessary finds the observation on the page and uses it. This continues for each value of the index that satisfies the subset criteria (a WHERE expression, for example).

With the index, the SAS System reads only the observations that match the subset criteria. The cost for an individual observation read for an index is higher, because the sequential access reads the page only once and then processes each observation. However, with the index, the SAS System does not read the
observations that do not meet the subset criteria. If the index selects a large portion of the observations, the increased cost of using the index eats away at the savings from the decreased number of reads.

When describing the index read above, note that the new page is read only if necessary. If it is already in memory, a new page read is not done. Therefore, if the data file is sorted in ascending order by the key variable(s), performance of statements using the index will be better, as fewer reads will be required.
The creation of an index, as well as maintaining the index when the data file is modified, require additional CPU usage.

The number of I/O operations required to read a subset of data may also increase with an index; the more random the data, the more I/O operations required to read the subset via an index. Maintaining the ascending value order of key variables will result in fewer I/O operations. In a worst case scenario, if the ascending order of the value’s observations were located on multiple pages on disk, an I/O operation would be necessary for each observation.

To create and use an index requires more memory and disk space than sequential access of the observations. The index is stored on disk, either as a separate file or as a part of the data file, depending on your operating environment.

5. create a data step view to save computation resources
http://www2.sas.com/proceedings/sugi29/067-29.pdf

Wednesday, June 18, 2014

Monday, June 9, 2014

VBA + SAS Libname

1. Combining SAS ® LIBNAME and VBA Macro to Import Excel ® file in an Intriguing, Efficient way
http://www.pharmasug.org/proceedings/2013/CC/PharmaSUG-2013-CC11.pdf

SAS add-in for microsoft office loader
SAS add-in 4.3 for microsoft office

The SAS® Financial Management Add-In for Microsoft Excel and Protected View


2. Using VBA and BASE SAS to Get Data from SAS to Excel 
http://www.phusewiki.org/docs/2005/PAPERS/AS11.pdf

Thursday, June 5, 2014

Using Email, pipe, printer, clipboard, ftp by SAS

1. The Power of  he FILENAME Statement
http://www.lexjansen.com/wuss/2012/63.pdf

Syntax:
FILENAME fileref <device-type> <'external-file'> <options>;

filename myfile disk|pipe|temp|dummy|printer|clipboard|url|email|ftp|dde "filepath"