SAS Shortcut

Automatically assign libraries at startup

Library assignments can be a drag sometimes. All you want is for your libraries to be automatically assigned in your session. Can you let SAS do this? Sure, here’s how (FYI, I’m suggesting an interactive method here but if you prefer writing code, you can certainly embed multiple Libname statements in your programs to assign them at startup or even include them in your autoexec.sas program file).

  1. Click on the New Library icon.
  2. Enter the library name and path.
  3. Check Enable at startup.
  4. Add the file path of where the database is location

Next time you open your SAS session, you’ll see the ORIN library is automatically assigned without any manual interference.

 

Connecting to SQL Server and Oracle Database

  1. Enter the library name
  2. Select “ODBC” From drop-down menu
  3. Check Enable at startup.
  4. Select a Data Source from the drop down menu (i.e. Create ODBC connection first and then come here to select the connection you create.)
  5. Add your user ID and Password
  6. Add “schema = dbo” if you want to see the contents of the database listed (E.g. Dataset)

 

RELATED POSTS

The Complete Guide to SAS Arrays

Are you looking to become a more efficient Data Step programmer? Do you often needRead More

PROC SQL: Using SAS

INSTRUCTIONS FOR CREATING TABLES AND USING CODE EXAMPLES Create the tables using the DATA stepsRead More

  • Top 10 Most Powerful Functions for PROC SQL
  • PROC IMPORT
  • PROC Export
  • SAS Shortcuts