Easysoft SQI-Zortec System Z Driver User Guide - Configuration

Configuring the Easysoft SQI-Zortec System Z Driver

This section explains how to check that the Easysoft SQI-Zortec System Z Driver is connecting to a sample System Z database and how to set up additional local data sources on both Windows and Unix.

Chapter Guide

Creating data sources

When the Easysoft SQI-Zortec System Z Driver is installed, a System Data Source called SAMPLE_SYSTEMZis automatically created to point at an Easysoft sample System Z database in the <InstallDir>\Easysoft\Easysoft Data Access for Zortec System Z\Demo directory on the server machine when the Easysoft SQI-Zortec System Z Driver is installed.

This is used as an example in Querying a data source on Windows and Querying a data source on Unix to illustrate how to validate that a connection has been made after the installation process has been completed.

Another data source called SYSTEMZ is also created, which contains empty data and schema directories which are ready to accept data definitions entered via the Easysoft Administrator.

The SYSTEMZ data source can be used to point directly at your own ISAM data or new data sources may be created, as shown in Creating additional data sources on Windows and Creating additional data sources on Unix, to:

A correctly configured data source can then be connected to from any ODBC-compliant application.

An example is provided in "Demonstration" on page 95.


NB

If you are implementing cross-platform access to your System Z data using the Easysoft ODBC-ODBC Bridge or the Easysoft JDBC-ODBC Bridge, see "Client Setup" on page 85.


Querying data sources

After installing the Easysoft SQI-Zortec System Z Driver it is a good idea to check that it is successfully accessing your System Z data.


NB

The following SQL utilities will not work correctly with the Easysoft SQI-Zortec System Z Driver if synonyms have not been detected in your System Z application data.

Synonyms are detected from a file called synonym.val, which can be specified by the database owner for each individual user.

You can do this either by using the Web Administrator (see "Adding Users" on page 79) or by specifiying an attribute for the data source (see Creating additional data sources on Windows or Creating additional data sources on Unix).


Querying a data source on Windows

On Windows, the Easysoft SQI-Zortec System Z Driver installs a program called sql.exe into <InstallDir>\Easysoft\Easysoft Data Access for Zortec System Z , which can be run with a data source as a parameter.

For example:

sql.exe "dsn=sample_systemz"

which points at the SAMPLE_SYSTEMZ Easysoft demo database.

When the Easysoft SQI-Zortec System Z Driver is installed, a System Data Source called SAMPLE_SYSTEMZis automatically created and the demo database is loaded into the <InstallDir>\Easysoft\Easysoft Data Access for Zortec System Z\Demo directory.

Querying a data source on Unix

On Unix, you can type SQL queries at the system prompt once you have installed the Easysoft SQI-Zortec System Z Driver, which allows you to test whether or not the Easysoft SQI-Zortec System Z Driver is successfully accessing your System Z data.

An Easysoft script called isql is provided to enable you to run the SQL command without needing to set LD_LIBRARY_PATH.

This script determines the LD_LIBRARY_PATH values from a separate configuration file (es.ld.so.conf) and then runs the 'sql' command, specifying the data source to query and the user name and password to use to access the data source.

By default, the isql script specifies:

User names and passwords can be set up by the database owner (see "Adding Users" on page 79).

If you have different logon details (e.g. if you want to query a different data source), edit the script to change those details.


NB

Before editing the isql script, you will need to allow write permissions to the file so that it can be edited, but remember to remove these after you have finished.


If you have more than one data source, you can create a copy of the isql script for each data source and specify the appropriate data source name in each copy of the script, giving you a script ready to run for querying each data source.

To query a data source using the isql script:

1.  Change into the <InstallDir>/easysoft/sqi/systemz directory.

2.  Type:

 ./isql

If an 'invalid user' or 'invalid password' error is displayed, check that the script specifies the correct user name and password.

If a line beginning "conn =" is displayed, then the connection has been made and you can type an SQL statement to query the data source.

For example:

 select * from info_schema.tables;

3.  To finish your SQL session, press <Enter> to return to the system prompt.

Another utility, also called isql, is included in unixODBC, the Open Source ODBC Driver Manager for non-Windows platforms, which is installed with the Easysoft SQI-Zortec System Z Driver on Unix.

To run this program:

1.  Change into the <InstallDir>/easysoft/unixODBC/bin directory.

2.  Type:

./isql DSN [UID [PWD]] [options]

where

Type ./isql only to get details of the possible options that you can enter.

Creating additional data sources on Windows

To create a data source connecting to your local System Z data:

1.  Select Start > Settings > Control Panel, double-click Administrative Tools and then Data Sources (ODBC).


9x

Select Start > Settings > Control Paneland double-click ODBC Data Sources (32bit).



NT

Select Start > Settings > Control Paneland double-click Data Sources (ODBC).


 The ODBC Data Source Administrator dialog box is displayed:

Figure 15: The ODBC Data Source Administrator

2.  Select the User DSN tab to set up a data source that only you can access.

¯ OR ¯

 Select the System DSN tab to create a data source which is available to anyone who logs on to this Windows machine.

3.  Click Add to add a new DSN.

 The Create New Data Source dialog box displays a list of the drivers which are available:

Figure 16: The Create New Data Source dialog box

4.  Select Easysoft Zortec System Z and then click Finish.

 A dialog box displays the fields required to configure an Easysoft SQI-Zortec System Z Driver data source:

Figure 17: The Easysoft SQI-Zortec System Z Driver DSN setup dialog box

The name of the User or System data source to be created, as used by the application when calling the SQLConnect or SQLDriverConnect functions.

This name cannot be changed once the data source has been created.

Descriptive text which may be retrieved by certain applications to describe the data source.

The user name (if any) with which you will connect to the data source.

The password (if any) for the user name you have entered in the User field.

The path of the data dictionary file (DD.dat) for the data that you want to access with this data source.

The path of the PN file for the data that you want to access with this data source.

The default path of the data that you want to access with this data source.

The directory where the schema files (views, users, passwords and privileges) for the data source are stored.

Each data source should have a different schema path to allow unique users and privileges to be specified.

If schema files (e.g. user.dat, user.idx) do not exist in the specified directory then a database owner ('dbo' user) with the password 'easysoft' is created, which can be used to set up more users and specify their access rights in the Web Administrator.

Select this attribute to enforce the System Z output length settings.

This might result in fields being truncated and data being lost.

Select this attribute to check that a table exists before it is loaded.

An error will be displayed if a table is not found.

Click Add to add a SYNONYM.VAL file to the list specified for this data source or click Delete to remove a SYNONYM.VAL file from the list specified for this data source.

Any synonym.val files listed here are checked only if no synonym.val file is specified for this user via the Web Administrator (see "Adding Users" on page 79 for details of specifying synonym.val per user via the Web Administrator).

5.  Click OK to create the data source, or click Cancel to abandon it.

 When your data source is correctly set up, you can connect to it from within ODBC-compliant applications such as Microsoft Access or Microsoft Excel (see "Demonstration" on page 95).

 The Updates button on the Easysoft Data Access for Zortec System Z DSN dialog box attempts to connect your machine to the Internet and get the latest version number for this software from the Easysoft version server.

 A message will be displayed if a more recent version of the software is available.

 If you have changed your data source configuration, you are advised to click OK on the dialog box to save the changes before accepting the new software.

Creating additional data sources on Unix

To create a data source connecting to your local System Z data requires you to edit the SYSTEMZ data source created during the installation, which contains empty data and schema directories that are ready to accept data definitions entered via the Easysoft Administrator:

1.  Change into the <InstallDir>/easysoft/sqi/systemz directory.

2.  Open the file dsn_template in an editor.

3.  Edit the following settings:

4.  Save the file under a new name.

5.  Change into the <InstallDir>/easysoft/unixODBC/bin directory.

6.  Type:

 odbc_system_dsn=1 ./odbcinst -i -s -ffilename

 where filename is the name you chose at step 4.

 This creates a system-wide data source in the odbc.ini file, so that it can be accessed by the unixODBC driver manager.

See Unix odbc.ini settings for details of other settings that you can specify in odbc.ini.


NB

Data sources can also be created by adding their attributes directly into the odbc.ini file.


Unix odbc.ini settings

If you are running the Easysoft SQI-Zortec System Z Driver on a Unix machine, you will probably set up data sources by editing dsn_template.sample (see Creating additional data sources on Unix).

However, if you intend to edit odbc.ini directly, you should be familiar with all the data source parameters that can be specified (by default, odbc.ini is located in the /etcdirectory):

Setting Description/Example
[data source name] e.g. [SYSTEMZ]
driver = ZORTEC_SYSTEMZ
sort_path =/tmp Temporary directory
sort_mem_size = 256 Amount of memory allocated for sorts before the results are saved to disk
rs_mem_size = 256 Number of rows that will cache into memory before being stored on disk
rs_path = /tmp Temporary directory
blob_path = /tmp Temporary directory
sqicount = 1 Number of SQI's this data source uses
target_string1 = Zortec System Z SQI Connection string for SQI
target_driver1 = /usr/local/easysoft/sqi/systemz/libessystemz_sqi.so Required SQI driver
dtcount = 1 Number of datatype libraries required for Zortec System Z
dtlibrary1 = /usr/local/easysoft/sqi/systemz/libessystemz_dt.so Data type library for data type conversions
data_path = path of the System Z application data e.g. /u/Z
dd_file = path of DD.dat file e.g. /u/Z/DD.dat
pn_file = path of PN file e.g. /u/Z/PN
synonyms = Number of SYNONYM.VAL files to check for this data source
synonum_n = Path of SYNONYM.VAL file to check for this data source. If you are using multiple SYNONYM.VAL files then you must list them in the order that you want them to be checked.
schema_path = /usr/local/easysoft/sqi/systemz/schema/ Directory where the data source's schema files (views, users, passwords and privileges) are stored. Specify a different schema path per data source so that you can set up different users and privileges for each data source.
cache_expiry = 2 How long files are cached open for (default is 2)
cache_maxopen = 30 Maximum number of concurrently cached files (default is 30)
logging = 3 See Logging options.
logfile = /tmp/systemz See Logging options.
default_uid = Specify a default user name for the data source. This overrides any user name specified on remote client machines.
default_pwd = Specify a default password for the data source. This overrides any password specified on remote client machines.

Figure 18: Unix odbc.ini settings

Logging options

By including particular settings in your odbc.ini file, you can specify various levels of logging.


Caution!

Enabling logging will seriously impair performance so remember to disable it once you have finished.


To enable logging, include the logfile= and the logging= lines in your odbc.ini file:

The log filename takes this prefix and the process ID.

For example, if you set logfile=/tmp/systemz then the log filename will be something like systemz_026503.log.

The values you can set it to are:

Log Number Log Description
1 logs entry to all functions and attributes to all calls in the SQI layer
2 logs exit from all functions
4 logs information regarding the file cache
8 logs information on opening of files and how many reads are performed
16 logs any expression checking that the SQI layer performs
32 logs any errors reported at the SQI layer
64 logs the selection of indexes used when starting a query
128 logs summary information about the SQI function calls

Figure 19: Unix logging settings

You can enable multiple logging options simply by adding the values together. For example, for entry, exit and expression logging, 1+2+16=19.

Checking for unsupported data types

System Z contains in excess of 200 data types and a platform-specific utility is provided with the Easysoft SQI-Zortec System Z Driver to detect any obscure data types which are not supported in the current release:


Win

1. Run a DOS prompt and change into the Program Files\Easysoft\Easysoft Data Access for Zortec System Z directory.

2. Type:

ddcheck -ddata dictionary file

where data dictionary file is the path and filename of your data dictionary. For example:

ddcheck -d \z\DD.dat



Unix

1. Change into the <InstallDir>/easysoft/sqi/systemz directory.

2. Type:

./ddcheck -ddata dictionary file

where data dictionary file is the path and filename of your data dictionary. For example:

./ddcheck -d /z/DD.dat


If your data contains any unsupported data types, they are listed on screen along with the file names that you should send to Easysoft if you want these data types to be resolved.