SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Quiz: Accessing Other Vendors' DBMS Data

Select the best answer for each question and click Score My Quiz.

  1. Once you associate a libref with a DBMS, which of the following tasks can you perform?

     a.   update a SAS data set with DBMS data
     b.   combine DBMS data and SAS data
     c.   update DBMS data or create a DBMS table
     d.   all of the above

  2. Suppose you submit the following SAS/ACCESS LIBNAME statement. How would you reference an ORACLE table named Profits that is stored in the library?
    libname region1 oracle
            user=tester1 password=testpw
            path=ora7db;            

     a.   Region1.Oracle
     b.   Oracle.Profits
     c.   Region1.Profits
     d.   Oracle.Region1

  3. Which SAS/ACCESS LIBNAME statement below associates the libref Mysybase with a SYBASE database and specifies engine connection options?

     a.  
    libname mysybase sybase user=testuser
            password=testpass database=testdb
            server=testserver; 
     
     b.  
    libname sybase mysybase user=testuser
            password=testpass database=testdb
            server=testserver; 
     
     c.  
    libname mysybase sybase dblink=sybase2
            preserve_col_names=yes; 
     
     d.   none of the above

  4. Which of the following statements is true?

     a.   Every DBMS supports all SAS/ACCESS LIBNAME options.
     b.   When you specify a SAS/ACCESS LIBNAME option, the option is applied to all objects (such as tables and views) in the database that the libref represents.
     c.   All SAS/ACCESS LIBNAME options are options that you specify to connect to a particular database.
     d.   all of the above

  5. Which of the following programs contains an error?

     a.  
    proc sql;
       connection to oracle as dblink
               (user=cestmoi pw=trustme 
                path=orapath connection=global);
       select *
          from connect dblink
             (select id, lastname
                 from employees 
    where salary>=30000);
    execute (grant update) by dblink; disconnect from dblink; quit;
     b.  
    proc sql;
       connect to sybase as syblink
               (user=testuser password=testpass 
                database=testdb server=testserver);
       select *
          from connection to syblink
             (select region, sales
                 from Sales 
    where sales>=500000);
    disconnect from syblink; quit;
     c.  
    proc sql;
       connect to db2 as db2link
               (ssid=db2 authid=testuser
                server=testserver);
       select *
          from connection to db2link
             (select flight, date, passengers
                 from march99);
       disconnect from db2link;
    quit;
     
     d.   all of the above

  6. Which of the following options must you specify in order to create a DBMS table with column names that match your case-sensitive SAS variable names?

     a.   preserve_col_names=no
     b.   validvarname=any
     c.   preserve_tab_names=yes
     d.   preserve_col_names=yes

  7. Which of the following identifies the part of SAS software that allows you to access you DBMS?

     a.   SAS/ACCESS LIBNAME options
     b.   SAS/ACCESS engine connection options
     c.   SAS/ACCESS-engine-name
     d.   all of the above

  8. Which of the following sends dynamic, non-query, SQL statements to a DBMS?

     a.   EXECUTE statement
     b.   CONNECTION TO component (in the FROM clause of the PROC SQL SELECT statement)
     c.   CONNECT statement
     d.   DISCONNECT statement

  9. What happens when you submit the following program?
    libname mysaslib 'c:\sas\sasdata';
    libname myoracle oracle
            user=tester1 password=testpw
            path=ora7db;
    libname myodbc odbc uid=testuser 
            pwd=testpass dsn=sqlservr;
    proc sql;
       select employee.id, lastname, firstname,
              grosspay, accountbalance
          from mysaslib.employee, myoracle.payroll,
               myodbc.profitsharing
          where employee.id=payroll.id and
                payroll.id=profitsharing.id
          order by lastname;
    quit;

     a.   The first LIBNAME statement generates errors because it doesn't specify a DBMS engine name and engine connection options. Then the PROC SQL step stops processing because the library Mysaslib isn't found.
     b.   The PROC SQL step joins SAS data, ORACLE data, and Microsoft SQL Server data.
     c.   The PROC SQL step stops processing because it attempts to join incompatible data types.
     d.   The PROC SQL step stops processing because it contains syntax errors.

  10. How can you terminate the connection to a DBMS?

     a.   submit a DISCONNECT statement in a PROC SQL step that connects to a DBMS
     b.   submit a SAS/ACCESS LIBNAME statement with the CLEAR option
     c.   without specifying a DISCONNECT statement, use a QUIT statement to end a PROC SQL step that connects to a DBMS
     d.   all of the above



back||next

Terms of Use & Legal Information | Privacy Statement