Reference: |
In order to access Db2 from FOCUS using CLI, you must create a CLIST or job that allocates all of the required FOCUS and Db2 data sets and has access to the configuration files.
The EDASERVE and FOCPROF members can either be placed directly in the user.CONF.CFG data set or they can be placed in a separate Partitioned DataSet (PDS) which you must concatenate to the hlq.ERRORS.DATA data set in the allocation for DDNAME ERRORS in your CLIST or JCL.
You can use the following CLIST as a sample after editing it to meet the standards at your site. In this example, user.DB2CLI.CFG in the allocation for DDNAME ERRORS contains the members EDASERVE and FOCPROF:
ALLOC F(FOCLIB) DA('hlq.FOCLIB.LOAD') SHR REUSE ALLOC F(ERRORS) DA('user.DB2CLI.CFG' - 'hlq.ERRORS.DATA') SHR REUSE ALLOC F(MASTER) DA('user.MASTER.DATA' - 'hlq.MASTER.DATA') SHR REUSE ALLOC F(FOCSQL) DA('user.FOCSQL.DATA' - 'hlq.FOCSQL.DATA') SHR REUSE ALLOC F(FOCEXEC) DA('user.FOCEXEC.DATA' - 'hlq.FOCEXEC.DATA') SHR REUSE CALL 'hlq.FOCLIB.LOAD(FOCUS)'
where:
Is the high-level qualifier for your FOCUS production data sets.
Is the high-level qualifier for the private version of a data set.
Note: Before executing your CLIST, you must be sure that your Db2 load libraries are available either by allocating them to DDNAME STEPLIB or by having them in the LINKLIST.
Execute the CLIST to invoke FOCUS and issue the following commands at the FOCUS prompt, pressing Enter after each line.
SQL DB2 ? SQL DB2 SELECT * FROM SYSIBM.SYSDUMMY1; END
If the adapter settings and the request output displayed, the installation and connection were successful. Issue the following command to exit FOCUS.
FIN
If you disabled Direct SQL Passthru, instead of getting the report output, you will get the following message.
(FOC1570) DIRECT PASSTHRU DISABLED ON THIS SERVER.
You should then run the following version of the request that does not use Direct SQL Passthru.
CREATE SYNONYM _edatemp/SYSDUM1 DROP FOR SYSIBM.SYSDUMMY1 DBMS DB2 END TABLE FILE _edatemp/SYSDUM1 PRINT * END
If the request output displayed, the installation and connection were successful. Issue the following command to exit FOCUS.
FIN
You can use the following JCL as a sample for creating a job that meets the standards at your site. In this example, user.DB2CLI.CFG in the allocation for DDNAME ERRORS contains the members EDASERVE and FOCPROF:
//FOCUSDB2 EXEC PGM=FOCUS,REGION=64M //STEPLIB DD DSN=DSNv10.SDSNEXIT,DISP=SHR // DD DSN=DSNv10.SDSNLOAD,DISP=SHR // DD DSN=hlq.FOCLIB.LOAD,DISP=SHR // DD DSN=hlq.FUSELIB.LOAD,DISP=SHR //ERRORS DD DSN=user.DB2CLI.CFG,DISP=SHR // DD DSN=hlq.ERRORS.DATA,DISP=SHR //FOCLIB DD DSN=hlq.FOCLIB.LOAD,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSTSPRT DD SYSOUT=* //FOCEXEC DD DSN=hlq.FOCEXEC.DATA,DISP=SHR //MASTER DD DSN=hlq.MASTER.DATA,DISP=SHR //FOCSQL DD DSN=user.FOCSQL.DATA,DISP=SHR //SYSIN DD * SQL DB2 ? SQL DB2 SELECT * FROM SYSIBM.SYSDUMMY1; END FIN /*
where:
Is your version of Db2, for example, B for version 11.
Is the high-level qualifier under which you installed FOCUS. In this example, hlq.FOCUS.DB2CLI.CFG contain the members EDASERVE and FOCPROF.
Is the high-level qualifier for a library allocated under the user ID of a specific user.
If the adapter settings and the request output displayed, the installation and connection were successful.
If you disabled Direct SQL Passthru, instead of getting the report output, you will get the following message.
(FOC1570) DIRECT PASSTHRU DISABLED ON THIS SERVER.
You should then run the following version of the request that does not use Direct SQL Passthru.
CREATE SYNONYM _edatemp/SYSDUM1 DROP FOR SYSIBM.SYSDUMMY1 DBMS DB2 END TABLE FILE _edatemp/SYSDUM1 PRINT * END
If the request output displayed, the installation and connection were successful.
|
Information Builders |