< Previous | Next >
WebSphere logo Classic Federation Server for z/OS, Version 9.1
WebSphere logo Classic Replication Server for z/OS, Version 9.1
WebSphere logo Classic Data Event Publisher for z/OS, Version 9.1
WebSphere logo Data Integration Classic Connector for z/OS, Version 9.1


Lesson 2.1: Creating a table within the physical data model

You create tables in your model, and when your tables are ready, you promote them to the data server. This lesson describes how to create a table within a physical data model.

Mapping a table to a data structure (in this tutorial, mapping a table to a group of records that are described in a COBOL copybook) involves:

To map a table to the sample data:

  1. Open the New VSAM Table wizard. Right-click SCHEMA in the First Model data model and select Add Classic Object > VSAM Table. The New VSAM Table wizard opens. The Database model field shows that the table will be created in the First Model data model of the Tutorial project. The Schema name field shows the schema within the First Model in which the table will be created. When you are creating your own tables, you can select an existing schema or create a new one by typing its name here.
  2. Specify the following information on the first page of the wizard and click Next:
    1. Select the sample copybook (CACEMPFD.CPY) by clicking the Browse button that is next to the Copybook field.
    2. Under Select table usage, select the Query check box to indicate that you will use the table to support queries by client applications.
    3. Under Create view, verify that No is selected. Although it is possible to create a view at the same time that you create the table that the view references, in this lesson you will create the table only.
  3. In the second page of the wizard do these steps and click Next:
    1. In the Select 01 level field, notice that the only 01 level from the copybook is selected. If the copybook contained more 01 levels, you would need to choose the level that corresponds to the data set that you are mapping.
    2. In the Table name field, notice that the default name is taken from the name of the 01 level. Do not change this field for this tutorial.
    3. Notice that the DS radio button is selected by default. This selection specifies that the VSAM file that contains the records that the copybook references is in a data set. The DD radio button specifies that the VSAM file is in a data set that has a DD name. Leave the DS radio button selected.
    4. In the Name field, type the name of the data set in which the sample VSAM file (CACEMPFD) is located. The name of the data set in which the file is located is high-level-qualifier.VSAM.EMPLOYEE where high-level-qualifier is the qualifier that was used when the CACPOST job created the file.
  4. On the next page of the wizard, select the records that you want to map as columns in the relational table that you are creating.
    1. Select the check box next to 01 EMPLOYEES. By selecting this check box, you indicate that for every record a column Classic Data Architect should create a column in the table.
    2. Click Next. The next page shows a description of the table that Classic Data Architect will create when you click Finish:
    Figure 1. The Summary page of the New VSAM Table wizard
    The Summary page of the Map VSAM Table wizard

    The Summary page shows that for each selected record there will be a column in the table that you are creating. This page also shows how the native data types are converted into SQL data types.

  5. Make changes to your table. Suppose that you must change the names of the columns to conform to naming guidelines for your project. You need to add a prefix to the name of each column. You also do not want to include the FILL_0 and FILL_1 columns in the table. To make these changes:
    1. Click Back to return to the previous page.
    2. Deselect the check boxes next to the FILL_0 and FILL_1 columns.
    3. To add the prefix ABC_ to the names of all of the columns, click the Rename All Elements button. The Rename All Elements window opens. In the Add prefix field, type ABC_. Then, click OK. The list of records should now look like this:
      Figure 2. List of records with the ABC_ prefix
      List of records with the ABC_ prefix
    4. Click Next to see the list of columns that Classic Data Architect will create in the table. Click Finish.
The EMPLOYEE table appears under SCHEMA in the Data Project Explorer.
Figure 3. The EMPLOYEE table in the Data Project Explorer
The EMPLOYEE table in the Data Project Explorer
Notice that VSAM follows the name of the table. Whenever you create a table in a physical data model, the name of the table is followed by the type of data source, such as VSAM, IMS™, or CA-IDMS.

Also, notice that there is a plus symbol next to the table. You can click that symbol to see a list of the columns that are in the table.

Finally, notice the asterisk next to the First Model.dbm folder. That asterisk indicates that you made changes to the model that you did not yet save. You can type CTRL+S to save the changes.



Feedback

Update icon Last updated: 2007-10-09


< Previous | Next >