SAS Notes

Compiled by : Wilson Suraweera @ CGHR
Contents
Random Numbers in SAS
Data Sub-setting
Method  for Select a Random Sample
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
External Resources
Macro Seminar - UCLA
Logistic regression
          Some Interesting SAS SQL Examples
SAS Dinosaur - Old and New way of SAS progrming
Paul Dicman's Web Page for SAS- This little old discusses SAS 8, but useful
Global Statements Dictionary - Alphabatical listing and Description of SAS Key words

 

         

  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