SAS Notes

Compiled by : Wilson Suraweera @ CGHR
Contents
Random Numbers in SAS
Data Sub-setting
Selection  of  two Random Samples
Identification and Separation of duplicate records in SAS dataset
Reshape Long list variable dataset to Wide list dataset
Missing values replacement with Means of the respective Variables
Logistic Regression with SAS
SAS made easy using Proc SQL
SAS PROC SQL procedure to access external ODBC data sources
SAS String Data Handling
SAS Missing value arithmetic's
          Update_a_Table_using_Another_Table_in_SAS
Text analysis - an Epidemiological Case Study by WS - SAS Institute HUG -01 April2011
 
External Resources
SAS Knowledge Base - Glossary of SAS Procedures from SAS.com
SAS resources from - UCLA
Logistic regression
          Survival Analysis : Usage of Proc LifeTest and Proc PHREG
SAS Dinosaur - Old and New way of SAS programming
Paul Dicman's Web Page for SAS- This little old discusses SAS 8, but useful
Global Statements Dictionary - Alphabetical listing and Description of SAS Key words
SAS Study Blog
SAS Canada - User Groups
         

  1. SAS and ODBC


    SAS uses the SAS/ACCESS module and the PROC SQL procedure to access external ODBC data sources. As with
    most SAS procedures, there is no point-and-click interface available and all of the steps will have to be accomplished
    using the SAS command language. Using PROC SQL, you can access any ODBC data source in SAS.

     Code from SAS end required to connect with the ODBC


    PROC SQL;
    CONNECT TO ODBC(DSN='con-Name'); 

     /* con-Name : is the ODBC connection name. Connection should be pre established */
    CREATE TABLE temp_sas AS
    SELECT * FROM CONNECTION TO ODBC( SELECT * FROM tab-Name );
    QUIT;

    /* Inside the ODBC( )  you can write complex queries instead of single table query shown above*/

            Source  Stat/Math center : Indiana University

Back to Top