To query or update data in a CA-IDMS database, you must create
a relational table that maps to that database. You can also create a view
on the table to filter record types or to filter rows and columns. You use
the New CA-IDMS Table wizard to create the table and
optionally the view.
Show
me!
Before you begin
- Configure the data server where you plan to run the query processor that
will accept requests from client applications.
- Create a metadata catalog.
- Decide which records to map to and the best path through the database
to access the records. The sets that are defined in the subschema for the
records determine the path.
- Configure a connection between the data server and your CA-IDMS database.
The data server must be able to access the CA-IDMS central version that contains
the subschema definitions, schema definitions, and data of the records that
are being mapped.
Restrictions
- The record path in the mapping must be from set owner to set member only.
- The owner DBKEY must be part of each member record that is included in
the path.
About this task
In
the New CA-IDMS Table wizard, you can map a single record or a specific path
to as many as 10 records. You define a path by starting with a single record,
and then navigating sets to additional records defined in the subschema. The
subschema information that you use for mapping determines which records and
sets are available. You can import the subschema information from a combination
of CA-IDMS schema and subschema report files or directly from the CA-IDMS
database by using Classic Data Architect's discovery process.
CA-IDMS
schema and subschema reports are produced by running the CA-IDMS schema and
subschema compilers and capturing the punched output into a z/OS® data set.
JCL to punch these reports is in the SCACSAMP library with the member name
CACIDPCH.
When the data server returns SQL rows for a logical table
that is mapped to a path, the data server returns an instance of the first
record type that is mapped with each instance of related records down the
defined path. See the example section
below.
For more information about creating tables and views that
map to CA-IDMS databases, see the related links for CA-IDMS syntax diagrams
and for views.
Procedure
To create a CA-IDMS table and optionally a
view for Classic federation:
- Map your CA-IDMS database to a relational table and optionally
a view by using the New CA-IDMS Table wizard.
- Open the wizard by right-clicking either the database in your
data design project or one of the schemas within the database. Select Add
Classic Object > CA-IDMS table.
- Select the CA-IDMS schema and subschema to base the table on.
- Choose whether to use the table for queries, updates, or both.
- Choose whether to create a view on the table.
- Provide information about how to access the CA-IDMS database.
- For each record in the path, specify a COBOL copybook, select
an 01 level if there is more than one 01 level, and then select the elements
you that want to map as columns in your relational table.
- Select the elements that you want to map to columns in your
relational table.
- If you are creating a view, specify the criteria for the WHERE
clause.
When you finish the wizard, the new table appears under the selected
schema. If you created a view, the view also appears under the selected schema.
- Optional: Modify the table properties or add privileges.
Select the table and make any changes in the Properties view.
- Optional: Create one or more indexes on the table. See Creating indexes.
- Optional: Generate the DDL for the table. You
can generate the DDL later, if you do not want to generate it now. You can
also generate the DDL for all of the objects within the same schema. See Generating DDL.
- Right-click the table and select Generate DDL.
- In the Generate DDL wizard, follow these steps:
- Choose to generate CREATE statements.
- Choose to generate DDL for tables. You can also choose to generate DDL
for indexes.
- Name the file in which to save the DDL within your project.
- Choose whether to run the DDL on a data server. After you run the DDL,
check the Data Output view to determine if the DDL ran successfully.
- Choose whether you want to open the DDL for editing.
- Optional: If you ran the DDL successfully on a data
server, validate the table by running a test query against your CA-IDMS database.
Be sure that the data server is connected to that database.
- In the Database Explorer, search your data server for the schema
that you created the table in. Expand the schema and expand the Tables folder.
- Right-click the table and select Data > Sample
Contents.
- Check the Data Output view to determine whether the test query
ran successfully.
- Optional: If you created a view, you can generate the
DDL for the view now or later. You can also generate the DDL for
all of the objects within the same schema. See Generating DDL.
- Right-click the view and select Generate DDL.
- In the Generate DDL wizard, follow these steps:
- Choose to generate CREATE and ALTER statements.
- Choose to generate DDL for views.
- Name the file in which to save the DDL within your project.
- Choose whether to run the DDL on a data server. After you run the DDL,
check the Data Output view to determine whether the DDL ran successfully.
- Choose whether to open the DDL for editing.
- Optional: If you ran the DDL successfully on a data
server, validate the view by running a test query against your CA-IDMS database.
Be sure that the data server is connected to that database.
- In the Database Explorer, search your data server for the schema
that you created the view in. Expand the schema and expand the Views folder.
- Right-click the view and select Data > Sample
Contents.
- Check the Data Output view to determine whether the test query
ran successfully.
Example
A path of records might look like
this:
PATH IS (EMPLOYEE, SET IS EMPL-DEP, DEPENDENT)
The
CA-IDMS might contain these records:
EMPLOYEE DEPENDENTS (in EMPL-DEP set)
----------- ---------
BILL SMITH -> MARTHA -> BILLY -> SALLY
JANE WHELAN
SANRA JONES -> ROBERT
The query to retrieve all the rows in
the mapped table returns:
EMPL_NAME DEPENDENT NAME
BILL SMITH MARTHA
BILL SMITH BILLY
BILL SMITH SALLY
JANE WHELAN ------
SANDRA JONES ROBERT