Creating PUBS tables

PUBS is a sample database that contains tables that you can use to test the transfer process between DB2 and SQL Server. Use the pubsdb2.sql script to create the tables by performing the following steps.

StepsTo create PUBS tables

  1. Start the DirectConnect server.

  2. If you are using Windows, display the Windows command line.

  3. Edit pubsdb2.sql to create the tables in the desired DB2 database and tablespace. For example, you can modify the script to say one of the following:

    • IN databasename.tablespacename

    • IN DATABASE dataspacename

    NoteThe user ID must have CREATE TABLE privileges in the specified databasename.tablespacename.

  4. Run pubsdb2.sql:

    isql -Uuserid -Ppassword -Sservice_name -ipubsdb2.sql
    

    where:

    • isql starts the utility of the same name.

    • userid is a valid DB2 user ID with CREATE TABLE privileges.

    • password is a valid password for the DB2 user ID you enter.

    • service_name is the DirectConnect service name.

    The script drops any tables with the same names as the tables it creates. If the table does not exist, the DropTable command returns an error message. This does not prevent successful execution of the rest of the script. The script creates indexes for the remaining tables.

  5. To verify that you successfully created the PUBS database in DB2, log in to DirectConnect for z/OS Option:

    isql -Uuserid -Ppassword -Sservice_name
    
  6. Issue this select statement against PUBS:

    select * from authors
    

    If you successfully created the PUBS database, DB2 returns data from the authors table.

    If you receive an error, run the pubsdb2.sql script again or review the log files.

For information about the transfer function, see the Mainframe Connect DirectConnect for z/OS Option Users Guide for DB2 Access Services.