DB2 Interfaces with S-Plus

S-Plus also makes use of an ODBC interface to communicate with the DB2 database. You must have the DB2 Client Enabler software installed on your PC for the interface to work properly.

  • To establish the ODBC connection in S-Plus, start S-Plus and choose File / Import Data / From ODBC connection from the menu. This will display a window similar to the one below.

    Import ODBC

  • Locate the ODBC data source which is available from the drop-down list. In this example we are connecting to SAMPLE. You will be prompted to enter a valid username and password to complete the connection.

    Connect to Database

  • Once the connection is established, the tables within the DB2 database (SAMPLE) become available for retrieval.

    Import ODBC

  • Select the table you wish to use. Note that the name of the S-PLUS data set you are importing to is by default the name of the DB2 database table. You may, however, modify the name.
  • Remember, you are actually importing the data. This means the resulting S-PLUS data set will look like the DB2 database table AT THE TIME YOU IMPORTED IT. This is not a link between the two (S-Plus and DB2). If the contents of the DB2 database table change you may need to update your S-PLUS datasets.
  • When you click OK, S-Plus will import the data from DB2.

More about...

  • DB2 - this link will provide access to the DB2 Online Books.
 

701 W. Broad St., Box 843059
Richmond, VA 23284
(804) 828-1177
RSS

 
VCU