To query or update data in a CICS® VSAM file, you must create a relational
table that maps to that file. You can also create a view on the table to filter
record types or to filter rows and columns. You use the New CICS
VSAM 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 record elements you want to map in the CICS VSAM file
and plan the indexes that you will need. To optimize performance, you must
map the underlying data correctly. This task includes ensuring that any indexes,
keys, or units of data that are defined in your file are defined to the data
server when you map the data.
- Configure a connection between the data server and your CICS VSAM file.
- In the COBOL Copybooks folder in your project, you must have a copybook
that gives the lists the records that you want to map to columns.
Restrictions
You can map to the following types of VSAM files:
- KSDS, ESDS, and RRDS files
- IAM files
About this task
For
more information about creating tables and views that map to CICS VSAM files,
see the related links for CICS VSAM syntax diagrams and for views.
Procedure
To create a CICS VSAM table and optionally a view for
Classic federation:
- Map your CICS VSAM file to a relational table and optionally
a view by using the New CICS VSAM 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 > CICS VSAM table.
- Select the copybook 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 which CICS file control table to use and how
to access the CICS VSAM
file.
- 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: Select the table and, in the Properties view,
modify any of its properties or add privileges.
- 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 whether 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 CICS VSAM file.
Be sure that the data server is connected to the system where the file is
located.
- 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, generate the DDL for
the view. You can generate the DDL 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 you want to save the DDL within your project.
- Choose whether to run the DDL on a data server. After running the DDL,
check the Data Output view to find out whether 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 view by running a test query against your CICS VSAM file.
Be sure that the data server is connected to the system where the file is
located.
- 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 whether the test query ran successfully.