Getting Started Under MVS

This section contains information about accessing each data adapter under MVS. Before you can invoke a data adapter, it must be installed and operational.

In this section:

Accessing DB2 Under MVS

Accessing Teradata Under MVS

Accessing IDMS SQL Under MVS

Accessing Oracle Under MVS

Interactive Access From MSO

Additional Prerequisites: File Descriptions

In the MVS operating environment, TSO or MSO controls the data adapter and the FOCUS session. The data adapter can access RDBMS tables interactively from TSO or MSO, with TSO batch processing, or as an MVS batch job.

You can allocate the FOCUS and data adapter load libraries (both from the same version and release of FOCUS) directly in your CLIST or REXX EXEC, or your site may choose to allocate them to DDNAME STEPLIB in your TSO logon procedure. (The FOCUS installation guide discusses the FOCUS CLIST in greater detail.)

To display the current FOCUS version and release, issue the ? RELEASE query command at the FOCUS prompt.

To run FOCUS interactively, you invoke a CLIST or REXX EXEC from TSO using standard allocations for DDNAMEs FOCEXEC, ERRORS, and MASTER. Also include allocations for DDNAMEs FOCSQL, USERLIB, and FOCLIB. Allocate FOCSQL to the library containing Access Files; allocate FOCLIB to the FOCUS product load library. Add the allocations for the FOCUS and data adapter load libraries to USERLIB. If multiple copies of the data adapter exist, the system will search USERLIB first, followed by FOCLIB, then STEPLIB.

The allocations in batch are similar to those in the CLIST, with a few changes. The STEPLIB allocation replaces the FOCLIB and USERLIB allocations from the CLIST. You must allocate the file containing executable FOCUS commands to DDNAME SYSIN. Output is written to the file or SYSOUT class allocated to DDNAME SYSPRINT.

The following topics provide CLIST and JCL examples for accessing each data adapter. The FOCUS commands are coded in-stream in the samples; however they could have been stored in a data set. The FIN command is required to terminate FOCUS.

For proper JOB card specifications and data set names for your site, consult with your system support staff. For additional information on FOCUS and batch processing, refer to your FOCUS documentation.

Note: The discussions in this section assume that all of your site's FOCUS and data adapter libraries are catalogued under the same MVS high-level qualifier. The examples throughout this section use the identifier prefix to refer to this high-level qualifier.


Top of page

Accessing DB2 Under MVS

You must know whether the data adapter was installed with the Call Attachment Facility (CAF) or TSO Attachment; the CLIST requirements are different in each case.

Example:

Allocating the Load Libraries in the TSO Logon Procedure

Interactive Access to DB2 From TSO

Batch Access to DB2

You must also know the four-character subsystem identifier (SSID) of the DB2 subsystem you will access and the plan name assigned to the DB2 Data Adapter when it was installed. The defaults for the SSID and plan values are DSN and DSQL respectively, unless your site changed these defaults at installation time.

If the data adapter was installed with the Call Attachment Facility (CAF), you can use the SET SSID and SET PLAN environmental commands to specify the SSID and plan name from FOCUS (see Environmental Commands). For non-CAF installations, your CLIST specifies SSID and PLAN when it invokes the DSN command processor.

After you prepare your CLIST or JCL, ask your database administrator whether you require SELECT, INSERT, and/or UPDATE privileges for the tables or views you wish to access.


Top of page

Example: Interactive Access to DB2 From TSO

If the FOCUS load libraries are not allocated in your TSO logon procedure, use the following CLIST (provided as member DB2EXCLI of the 'prefix.FOCSQL.DATA' data set) after editing it to conform to your site's standards. This CLIST assumes that the data adapter was installed with the Call Attachment Facility (CAF)

PROC 0
CONTROL MSG NOLIST NOFLUSH
ALLOC F(FOCEXEC) DA('user.FOCEXEC.DATA'
'prefix.FOCEXEC.DATA') SHR REUSE
ALLOC F(MASTER) DA('user.MASTER.DATA'
'prefix.MASTER.DATA') SHR REUSE
ALLOC F(FOCSQL) DA('user.FOCSQL.DATA'
'prefix.FOCSQL.DATA') SHR REUSE
ALLOC F(TRF) DA('user.TRF.DATA'
'prefix.FOCSQL.DATA') SHR REUSE
ALLOC F(ERRORS) DA('prefix.ERRORS.DATA') SHR REUSE
ALLOC F(USERLIB) DA('prefix.FOCSQL.LOAD'
'prefix.FOCLIB.LOAD'
'prefix.FUSELIB.LOAD') SHR REUSE
ALLOC F(FOCLIB) DA('prefix.FOCLIB.LOAD') SHR REUSE
CALL 'prefix.FOCLIB.LOAD(FOCUS)'

where:

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

user
Is the high-level qualifier for your private version of a library.

Note: The allocation for DDNAME TRF (a FOCUS Window Transfer File PDS) is included because it is required for the FOCUS EXPLAIN utility. The EXPLAIN utility is discussed in The Data Adapter Optimizer.

If the data adapter was installed to use TSO Attachment:

Your DB2 database administrator can supply the parameters and the attachment facility chosen at the time the data adapter was installed.


Top of page

Example: Allocating the Load Libraries in the TSO Logon Procedure

Note: This is a requirement if the data adapter was installed to use TSO Attachment.


Top of page

Example: Batch Access to DB2

For batch access, you must submit JCL that allocates the required libraries. If the data adapter was installed with the Call Attachment Facility, you can use the following sample JCL (provided as member DB2EXJCA of the 'prefix.FOCSQL.DATA' data set) after editing it to conform to your site's standards and adding a JOB card

//JOB card goes here
//BATCAF EXEC PGM=FOCUS
//STEPLIB DD DISP=SHR,DSN=prefix.FOCSQL.LOAD
// DD DISP=SHR,DSN=prefix.FOCLIB.LOAD
// DD DISP=SHR,DSN=prefix.FUSELIB.LOAD
// DD DISP=SHR,DSN=DSN710.SDSNLOAD
//ERRORS DD DISP=SHR,DSN=prefix.ERRORS.DATA
//FOCEXEC DD DISP=SHR,DSN=user.FOCEXEC.DATA
// DD DISP=SHR,DSN=prefix.FOCEXEC.DATA
//MASTER DD DISP=SHR,DSN=user.MASTER.DATA
// DD DISP=SHR,DSN=prefix.MASTER.DATA
//FOCSQL DD DISP=SHR,DSN=user.FOCSQL.DATA
// DD DISP=SHR,DSN=prefix.FOCSQL.DATA
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
SQL DB2 SET SSID ssid
SQL DB2 SET PLAN plan
TABLE FILE db2table
.
.
.
END
FIN
/*

where:

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

user
Is the high-level qualifier for your private version of a library.

ssid
Is the DB2 subsystem identifier, used to access a subsystem other than the default.

plan
Is the name of the data adapter application plan.

db2table
Is the name of the Master File for the DB2 table or view.

Note: The need for data adapter SET commands depends on the particular application.

If the data adapter was installed to use the TSO Attachment Facility, execute the TSO batch program, IKJEFT01, which in turn calls FOCUS. You can use the following sample JCL (provided as member DB2EXJCT of the 'prefix.FOCSQL.DATA' data set) after editing it to conform to your site's standards and adding a JOB card

//JOB card goes here
//BATTSO EXEC PGM=IKJEFTO1
//STEPLIB DD DISP=SHR,DSN=prefix.FOCSQL.LOAD
// DD DISP=SHR,DSN=prefix.FOCLIB.LOAD
// DD DISP=SHR,DSN=prefix.FUSELIB.LOAD
// DD DISP=SHR,DSN=DSN710.SDSNLOAD
//ERRORS DD DISP=SHR,DSN=prefix.ERRORS.DATA
//FOCEXEC DD DISP=SHR,DSN=user.FOCEXEC.DATA
// DD DISP=SHR,DSN=prefix.FOCEXEC.DATA
//MASTER DD DISP=SHR,DSN=user.MASTER.DATA
// DD DISP=SHR,DSN=prefix.MASTER.DATA
//FOCSQL DD DISP=SHR,DSN=user.FOCSQL.DATA
// DD DISP=SHR,DSN=prefix.FOCSQL.DATA
//SYSPRINT DD SYSOUT=A
//SYSTSPRT DD SYSOUT=A
//SYSTSIN DD *
DSN SYSTEM(ssid)
RUN PROGRAM(FOCUS) PLAN(plan) LIBRARY('prefix.FOCLIB.LOAD')
END
//SYSIN DD *
  TABLE FILE db2table
.
.
.
END
FIN
/*

where:

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

user
Is the high-level qualifier for the your private version of a library.

ssid
Is the DB2 subsystem identifier, used to access a subsystem other than the default.

plan
Is the name of the data adapter application plan.

db2table
Is the name of the Master File for the DB2 table or view.


Top of page

Accessing Teradata Under MVS

The communications link between your address space and the Teradata Director Program (TDP) is implemented with either MVS/XMS (Cross Memory Services) or Supervisor Call (SVC). (Your systems programming group determines the type of link during Teradata installation.)

Example:

Interactive Access to Teradata From TSO

Batch Access to Teradata

After you prepare your CLIST or JCL, you must:

For DBC/SQL GRANT information and the SET CONNECTION_ATTRIBUTES command, see Connection, Authentication, and Security.

For information about the data adapter SET AUTOCLOSE command, which enables you to control logon interaction with Teradata, see Controlling Connection Scope.


Top of page

Example: Interactive Access to Teradata From TSO

If the FOCUS load libraries are not allocated in your TSO logon procedure, use the following CLIST

PROC 0
CONTROL MSG NOLIST NOFLUSH
ALLOC F(FOCEXEC) DA('user.FOCEXEC.DATA'
'prefix.FOCEXEC.DATA') SHR REUSE
ALLOC F(MASTER) DA('user.MASTER.DATA'
'prefix.MASTER.DATA'
'prefix.FOCDBC.DATA') SHR REUSE
ALLOC F(FOCSQL) DA('user.FOCDBC.DATA'
'prefix.FOCDBC.DATA') SHR REUSE
ALLOC F(TRF) DA('user.TRF.DATA'
'prefix.FOCDBC.DATA') SHR REUSE
ALLOC F(ERRORS) DA('prefix.ERRORS.DATA') SHR REUSE
ALLOC F(USERLIB) DA('prefix.FOCDBC.LOAD'
'prefix.FOCLIB.LOAD'
'prefix.FUSELIB.LOAD') SHR REUSE
ALLOC F(FOCLIB) DA('prefix.FOCLIB.LOAD') SHR REUSE
CALL 'prefix.FOCLIB.LOAD(FOCUS)'

where:

prefix
Is the high-level qualifier for the FOCUS production libraries.

user
Is the high-level qualifier for your private version of the library.

Note:

If you wish to allocate the FOCUS and data adapter load libraries in the TSO logon procedure, use the following JCL as a model. The CLIST above should be altered to eliminate the allocations for FOCLIB and USERLIB DDNAMEs:

//LOGON    EXEC     PGM=IKJEFT01,REGION=2048K,DYNAMNBR=25
//STEPLIB DD DSN=prefix.FOCDBC.LOAD,DISP=SHR
// DD DSN=prefix.FOCLIB.LOAD,DISP=SHR
// DD DSN=prefix.FUSELIB.LOAD,DISP=SHR

Top of page

Example: Batch Access to Teradata

To run as a batch job, JCL must be coded to allocate the libraries required by FOCUS and to call the application program. The following JCL sample calls the FOCUS program directly

//JOB card goes here
//BATCH EXEC PGM=FOCUS,REGION=2048K
//STEPLIB DD DISP=SHR,DSN=prefix.FOCDBC.LOAD
// DD DISP=SHR,DSN=prefix.FOCLIB.LOAD
// DD DISP=SHR,DSN=prefix.FUSELIB.LOAD
//ERRORS DD DISP=SHR,DSN=prefix.ERRORS.DATA
//FOCEXEC DD DISP=SHR,DSN=user.FOCEXEC.DATA
// DD DISP=SHR,DSN=prefix.FOCEXEC.DATA
//MASTER DD DISP=SHR,DSN=user.MASTER.DATA
// DD DISP=SHR,DSN=prefix.MASTER.DATA
//FOCSQL DD DISP=SHR,DSN=user.FOCDBC.DATA
// DD DISP=SHR,DSN=prefix.FOCDBC.DATA
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
/*
SQL SQLDBC SET CONNECTION_ATTRIBUTES 0/JANE,JANE;
TABLE FILE dbctable
.
.
END
FIN
/*

where:

prefix
Is the high-level qualifier for the FOCUS production libraries.

user
Is the high-level qualifier for your private version of the library.

To run the batch job indirectly, specify the TSO batch program, IKJEFT01, which in turn calls FOCUS. The following example may be used as a model.

//JOB card goes here
//BATTSO EXEC PGM=IKJEFT01,REGION=2048K

Top of page

Accessing IDMS SQL Under MVS

Steps for invoking the data adapter vary from site to site; you may be required to complete a series of menus or to execute a CLIST. Since the data adapter can operate under IDMS Central Version or in Local Mode, you need to include allocations for the appropriate mode in your CLIST or JCL.

In this section:

CA-IDMS Central Version and Local Mode

Example:

Interactive Access to CA- IDMS/DB From TSO

Batch Access to CA-IDMS/DB

After you prepare your CLIST or JCL, ask your database administrator whether you require SELECT, INSERT, and/or UPDATE privileges for the tables or views you need to access.

If your database administrator (DBA) has turned on IDMS SQL security, the proper privileges must be granted to every IDMS/SQL Data Adapter user. The DBA should grant you:

For more information on security and table privileges, consult Connection, Authentication, and Security. Additional prerequisites and file types are discussed in this chapter.


Top of page

Example: Interactive Access to CA-IDMS/DB From TSO

If the FOCUS load libraries are not allocated in your TSO logon procedure, use the following CLIST (provided as member SQLIDMCL of the 'prefix.IDMS.DATA' data set) after editing it to conform to your site's standard:

PROC 0
CONTROL MSG NOLIST NOFLUSH
ALLOC F(FOCEXEC) DA('user.FOCEXEC.DATA'
'prefix.FOCEXEC.DATA') SHR REUSE
ALLOC F(MASTER) DA('user.MASTER.DATA'
'prefix.MASTER.DATA') SHR REUSE
ALLOC F(FOCSQL) DA('user.FOCSQL.DATA'
'prefix.ACCESS.DATA') SHR REUSE

ALLOC F(ERRORS) DA('prefix.ERRORS.DATA') SHR REUSE
ALLOC F(USERLIB) DA('prefix.IDMS.LOAD'
'prefix.FOCLIB.LOAD'
'prefix.FUSELIB.LOAD') SHR REUSE
ALLOC F(FOCLIB) DA('prefix.FOCLIB.LOAD') SHR REUSE
CALL 'prefix.FOCLIB.LOAD(FOCUS)'

where:

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

user
Is the high-level qualifier for your private version of a library.

If you want to allocate the FOCUS and data adapter load libraries in the TSO logon procedure, use the following JCL as a model. Alter the preceding CLIST to eliminate the allocations for DDNAMEs FOCLIB and USERLIB.

Concatenate the libraries to DDNAME STEPLIB as in the following sample:

//LOGON     EXEC  PGM=IKJEFT01
//STEPLIB DD DSN=prefix.IDMS.LOAD,DISP=SHR
// DD DSN=prefix.FOCLIB.LOAD,DISP=SHR
// DD DSN=prefix.FUSELIB.LOAD,DISP=SHR
// DD DSN=IDMS.LOAD,DISP=SHR

Top of page

Example: Batch Access to CA-IDMS/DB

For batch access, you must submit JCL that allocates the required libraries. Edit the following example to conform to your site's standards and add a JOB card:

//JOB card goes here
//BATCH EXEC PGM=FOCUS
//STEPLIB DD DISP=SHR,DSN=prefix.IDMS.LOAD
// DD DISP=SHR,DSN=prefix.FOCLIB.LOAD
// DD DISP=SHR,DSN=prefix.FUSELIB.LOAD
// DD DISP=SHR,DSN=IDMS.LOAD
//ERRORS DD DISP=SHR,DSN=prefix.ERRORS.DATA
//FOCEXEC DD DISP=SHR,DSN=user.FOCEXEC.DATA
// DD DISP=SHR,DSN=prefix.FOCEXEC.DATA
//MASTER DD DISP=SHR,DSN=user.MASTER.DATA
// DD DISP=SHR,DSN=prefix.MASTER.DATA
//FOCSQL DD DISP=SHR,DSN=user.FOCSQL.DATA
// DD DISP=SHR,DSN=prefix.ACCESS.DATA
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
TABLE FILE idmstable
.
.
.
END
FIN

where:

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

user
Is the high-level qualifier for your private version of a library.

idmstable
Is the name of the Master File for the IDMS SQL table or view.


Top of page

CA-IDMS Central Version and Local Mode

Instructions for accessing IDMS data sources differ for Central Version (CV) access and Local Mode access. For either mode, you must allocate:

For Central Version access only, you must allocate:

For Local Mode access only, you must allocate:

Note:


Top of page

Accessing Oracle Under MVS

Your CLIST or batch JCL must indicate which Oracle subsystem is to be accessed.

In this section:

Interactive Access From MSO

Additional Prerequisites: File Descriptions

How to:

Connect to the Oracle Subsystem

Example:

Interactive Access to Oracle From TSO

Batch Access to Oracle

Accessing the Data Adapter From MSO

Note: All Oracle tools and programs that use the Oracle Pro or High Level Interfaces (such as the Oracle Data Adapter) require the services of the SQL Storage Anchor Module (SQLANKOR). This module resides in a library member for which the Oracle-recommended name is:

'ORACLE.V8R1M5.CMDLOAD(CMDLOAD)' (for Oracle Version 8).

This module is generally placed in a STEPLIB, JOBLIB or system linklist library. It must be present at run time.

Any application that accesses the Oracle RDBMS must provide a means of connecting to the Oracle subsystem (or kernel). The subsystem is identified by a unique 1- to 4-character MVS subsystem name.


Top of page

Procedure: How to Connect to the Oracle Subsystem

At run time, the Oracle subsystem is specified by allocating the ORA@ssn DDNAME, where ssn is the subsystem name. For example, if your Oracle subsystem were named ORAT, you would issue one of the following statements:

In batch JCL

//ORA@ORAT    DD   DUMMY

In a CLIST

ALLOC FI(ORA@ORAT) DUMMY

These statements are included in the sample JCL and CLIST.


Top of page

Example: Interactive Access to Oracle From TSO

A sample CLIST is provided as member ORAEXCLI in the 'prefix.FOCSQL.DATA' data set:

PROC 0
CONTROL MSG NOLIST
ALLOC F(ORA@ORAT) DUMMY
ALLOC F(FOCEXEC) DA ('user.FOCEXEC.DATA' -
'prefix.FOCEXEC.DATA') SHR REUSE
ALLOC F(MASTER) DA ('user.MASTER.DATA' -
'prefix.MASTER.DATA') SHR REUSE
ALLOC F(FOCSQL) DA ('user.FOCSQL.DATA' -
'prefix.FOCSQL.DATA') SHR REUSE

ALLOC F(USERLIB) DA ('prefix.FOCSQL.LOAD' -
('prefix.FOCLIB.LOAD' -
'prefix.FUSELIB.LOAD') SHR REUSE
ALLOC F(FOCLIB) DA ('prefix.FOCLIB.LOAD') SHR REUSE

CALL 'prefix.FOCLIB.LOAD(FOCUS)'

where:

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

user
Is the high-level qualifier for your private version of a library.

The allocations for DDNAMEs FOCLIB and USERLIB may be removed if their libraries (FOCLIB.LOAD, FOCSQL.LOAD, and FUSELIB.LOAD) are allocated to STEPLIB in the TSO logon procedure.


Top of page

Example: Batch Access to Oracle

To run as a batch job, the JCL must allocate the required libraries and execute the application program. The most efficient approach is to call the FOCUS program directly. Alternatively, users may choose to call the TSO batch program, IKJEFT01, which in turn calls FOCUS. In this example, a direct FOCUS call is illustrated.

Sample JCL is provided as member ORAEXJCL in the 'prefix.FOCSQL.DATA' data set:

// JOB card goes here
//BATCH EXEC PGM=FOCUS,REGION=2560K
//ORA@ORAT DD DUMMY
//CONNECT DD DISP=SHR,DSN=ORACLE.USERS.LIST(RALPH)
//STEPLIB DD DISP=SHR,DSN=prefix.FOCSQL.LOAD
// DD DISP=SHR,DSN=prefix.FOCLIB.LOAD
// DD DISP=SHR,DSN=prefix.FUSELIB.LOAD
//FOCEXEC DD DISP=SHR,DSN=prefix.FOCEXEC.DATA
// DD DISP=SHR,DSN=FOCEXEC.DATA
//MASTER DD DISP=SHR,DSN=prefix.MASTER.DATA
// DD DISP=SHR,DSN=MASTER.DATA
//FOCSQL DD DISP=SHR,DSN=prefix.FOCSQL.DATA
// DD DISP=SHR,DSN=FOCSQL.DATA
//SYSPRINT DD SYSOUT=A
//SYSIN DD *

FOCUS request goes here, for example:

table file oratable
count col1 by col2
where col3 eq 'literal'
end

fin
/*

where:

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

user
Is the high-level qualifier for your private version of a library.

oratable
Is the name of the Master File for the Oracle table or view.

Whether invoked interactively or in batch, an Oracle userid and password must be provided to the Oracle RDBMS. For more information on Oracle login and security issues, see Connection, Authentication, and Security.


Top of page

Interactive Access From MSO

To access the data adapter from MSO, you must allocate the data adapter files using DYNAM commands. You can include these allocations in a FOCEXEC.


Top of page

Example: Accessing the Data Adapter From MSO

The following FOCEXEC example allocates the data adapter files

-* DDNAME FOCEXEC
DYNAM ALLOC FILE FOCEXEC DA user.FOCEXEC.DATA SHR REUSE
DYNAM ALLOC FILE FOCPROG DA prefix.FOCEXEC.DATA SHR REUSE
DYNAM CONCAT FILE FOCEXEC FOCPROG
-* DDNAME MASTER
DYNAM ALLOC FILE MASTER DA user.MASTER.DATA SHR REUSE
DYNAM ALLOC FILE FOCMAST DA prefix.MASTER.DATA SHR REUSE
DYNAM CONCAT FILE MASTER FOCMAST
-* DDNAME FOCSQL
DYNAM ALLOC FILE FOCSQL DA user.FOCSQL.DATA SHR REUSE
DYNAM ALLOC FILE FOCAFD DA prefix.FOCSQL.DATA SHR REUSE
DYNAM CONCAT FILE FOCSQL FOCAFD
-* DDNAME TRF
DYNAM ALLOC FILE TRF DA user.TRF.DATA SHR REUSE
DYNAM ALLOC FILE FOCTRF DA prefix.FOCSQL.DATA SHR REUSE
DYNAM CONCAT FILE TRF FOCTRF

where:

user
Is the high-level qualifier for your private version of a library.

prefix
Is the high-level qualifier for your site's FOCUS production libraries.

Note:


Top of page

Additional Prerequisites: File Descriptions

The data adapter requires a Master and Access File for each RDBMS table referenced by FOCUS. In MVS, file descriptions and FOCEXECs are stored as members of partitioned data sets (PDSs). The partitioned data sets are allocated to the following DDNAMEs:

DDNAME

Contents (PDS Members)

MASTER

Master Files.

FOCSQL

Access Files.

FOCEXEC

Stored procedures.

Execute the AUTODB2 FOCEXEC supplied with the DB2 Data Adapter or the AUTODBC CLIST supplied with the Teradata Data Adapter, to automatically create Master and Access Files for existing RDBMS tables. You can customize the resulting descriptions with a text editor. Automated Procedures describes step-by-step instructions for the AUTO facilities.

You can create new table definitions in the RDBMS from the FOCUS environment by issuing either the FOCUS CREATE FILE command (after creating a Master File and an Access File) or the SQL CREATE TABLE command. See Automated Procedures for the FOCUS CREATE FILE command.


Information Builders