Skip to main content

COBSQL ORACLE_XA Connection setup

  • August 1, 2014
  • 2 replies
  • 0 views

I am trying to establish and execute my COBSQL program using Oracle_XA connection on Microfocus Enterprise server 2.2 but the connection is not getting invoked.

I am able to build and compile my COBSQL program with following directives

CONFIRM CONSTANT DATABASE"ORACLE" p(cobsql) CSQLT=ORACLE8 CST CSP DIS MAKESYN SQLDEBUG VERBOSE KEEPCBL END-C p(cp) CONFIRM LIMITED-SEARCH ENDP ENDP
LITLINK SOURCETABSTOP(4) ASSIGN (EXTERNAL) PROTECT-LINKAGE  FCDCAT INDD(SYSIN 80 R) OUTDD(SYSOUT 121 L) ANIM ERRFORMAT(2) NOQUERY NOERRQ

Here is my Oracle_XA connection detail setup under Server/Resource manager/XA Tab

Enabled ID Name Module Open string Close string Description
DBP1 DBP1 /var/mfcobol/es/TF64BT/SYSTEM/xa/ESORAXA64.so Oracle_XA DB=ORACLESERVERHOSTNAME SqlNet=ORACLESIDNAME ACC=P/USERNAME/PASSWORD SesTM=10 LogDir=/var/mfcobol/es/TF64BT/SYSTEM/xa DbgFl=0x4

Here is details of my LD_LIBRARY_PATH environment varible details

LD_LIBRARY_PATH   /u01/app/microfocus/ent_development/lib:/u01/app/microfocus/ent_development/lib:/u01/app/oracle/product/11.2.0/client_1/lib

 

When I start the server, I can see the XA connection is established correctly, here is log

140731 14055079      10571 TF64BT   JES000042I SSTM not enabled: CICS 14:05:50                                                                                                                                                                                                                     
140731 14055083      10571 TF64BT   CASXO0020I DBP1 XA interface loaded. Name(Oracle_XA), Registration Mode(Static) 14:05:50                                                                                                                                                                       
140731 14055083      10571 TF64BT   CASXO0021I DBP1 XA interface local transaction support enabled 14:05:50                                                                                                                                                                                        
140731 14055088      10571 TF64BT   CASXO0015I DBP1 XA interface initialized successfully 14:05:50                                                                                                                                                                                                 
140731 14055088      10571 TF64BT   CASSI5001I PLTPI Phase 1 - No PLT Specified 14:05:50       

Here is my Program contents

      $SET directives"sql.dir" 
       program-id. ORATEST as "ORATEST".

       environment division.
       configuration section.

       data division.
       working-storage section.
           EXEC SQL INCLUDE SQLCA    END-EXEC.                          
           EXEC SQL BEGIN DECLARE SECTION END-EXEC
                01  W-NAME   PIC X(100).
           EXEC SQL END DECLARE SECTION END-EXEC.

       procedure division.
             
             EXEC SQL
                 select cust_name INTO :W-NAME      from tblcustomer
                     where  customer_id='12345678'
             END-EXEC
             
             DISPLAY 'customer name = ' W-NAME
             DISPLAY 'SQL CODE= ' SQLCODE
             DISPLAY 'SQL STATE= ' SQLSTATE
             DISPLAY 'SQL ERROR MESSAGE= ' SQLERRMC
             DISPLAY '**********'


	     stop run.

 

Here is my JCL to contents

//ORATEST  JOB (ORATEST),CLASS=4,MSGCLASS=J,MSGLEVEL=(1,1)
//*
//*
//*-----------------------------------------------------------------*
//* TEST ORACLE XA CONNECTION *
//*-----------------------------------------------------------------*
//STEP05 EXEC PGM=IKJEFT01
//IEFRDER DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYS(DBP1)
RUN PROGRAM(ORATEST)
END
/*

When I submit my job, I am not getting any output or SQL state. I checked with DBA, and as per him no connection getting established while submitting JCL job

Please advise

 

Thanks in Advance

Anil Varma


#Oracle
#COBSQL
#EnterpriseServer
#oracle_xa

2 replies

I am trying to establish and execute my COBSQL program using Oracle_XA connection on Microfocus Enterprise server 2.2 but the connection is not getting invoked.

I am able to build and compile my COBSQL program with following directives

CONFIRM CONSTANT DATABASE"ORACLE" p(cobsql) CSQLT=ORACLE8 CST CSP DIS MAKESYN SQLDEBUG VERBOSE KEEPCBL END-C p(cp) CONFIRM LIMITED-SEARCH ENDP ENDP
LITLINK SOURCETABSTOP(4) ASSIGN (EXTERNAL) PROTECT-LINKAGE  FCDCAT INDD(SYSIN 80 R) OUTDD(SYSOUT 121 L) ANIM ERRFORMAT(2) NOQUERY NOERRQ

Here is my Oracle_XA connection detail setup under Server/Resource manager/XA Tab

Enabled ID Name Module Open string Close string Description
DBP1 DBP1 /var/mfcobol/es/TF64BT/SYSTEM/xa/ESORAXA64.so Oracle_XA DB=ORACLESERVERHOSTNAME SqlNet=ORACLESIDNAME ACC=P/USERNAME/PASSWORD SesTM=10 LogDir=/var/mfcobol/es/TF64BT/SYSTEM/xa DbgFl=0x4

Here is details of my LD_LIBRARY_PATH environment varible details

LD_LIBRARY_PATH   /u01/app/microfocus/ent_development/lib:/u01/app/microfocus/ent_development/lib:/u01/app/oracle/product/11.2.0/client_1/lib

 

When I start the server, I can see the XA connection is established correctly, here is log

140731 14055079      10571 TF64BT   JES000042I SSTM not enabled: CICS 14:05:50                                                                                                                                                                                                                     
140731 14055083      10571 TF64BT   CASXO0020I DBP1 XA interface loaded. Name(Oracle_XA), Registration Mode(Static) 14:05:50                                                                                                                                                                       
140731 14055083      10571 TF64BT   CASXO0021I DBP1 XA interface local transaction support enabled 14:05:50                                                                                                                                                                                        
140731 14055088      10571 TF64BT   CASXO0015I DBP1 XA interface initialized successfully 14:05:50                                                                                                                                                                                                 
140731 14055088      10571 TF64BT   CASSI5001I PLTPI Phase 1 - No PLT Specified 14:05:50       

Here is my Program contents

      $SET directives"sql.dir" 
       program-id. ORATEST as "ORATEST".

       environment division.
       configuration section.

       data division.
       working-storage section.
           EXEC SQL INCLUDE SQLCA    END-EXEC.                          
           EXEC SQL BEGIN DECLARE SECTION END-EXEC
                01  W-NAME   PIC X(100).
           EXEC SQL END DECLARE SECTION END-EXEC.

       procedure division.
             
             EXEC SQL
                 select cust_name INTO :W-NAME      from tblcustomer
                     where  customer_id='12345678'
             END-EXEC
             
             DISPLAY 'customer name = ' W-NAME
             DISPLAY 'SQL CODE= ' SQLCODE
             DISPLAY 'SQL STATE= ' SQLSTATE
             DISPLAY 'SQL ERROR MESSAGE= ' SQLERRMC
             DISPLAY '**********'


	     stop run.

 

Here is my JCL to contents

//ORATEST  JOB (ORATEST),CLASS=4,MSGCLASS=J,MSGLEVEL=(1,1)
//*
//*
//*-----------------------------------------------------------------*
//* TEST ORACLE XA CONNECTION *
//*-----------------------------------------------------------------*
//STEP05 EXEC PGM=IKJEFT01
//IEFRDER DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYS(DBP1)
RUN PROGRAM(ORATEST)
END
/*

When I submit my job, I am not getting any output or SQL state. I checked with DBA, and as per him no connection getting established while submitting JCL job

Please advise

 

Thanks in Advance

Anil Varma


#Oracle
#COBSQL
#EnterpriseServer
#oracle_xa

retyping the Open string as the viewer is not displaying complete contents

Oracle_XA DB=ORACLESERVERHOSTNAME SqlNet=ORACLESIDID ACC=P/USERNAME/PASSWORD SesTM=10 LogDir=/var/mfcobol/es/TF64BT/SYSTEM/xa DbgFl=0x4


  • August 1, 2014

I am trying to establish and execute my COBSQL program using Oracle_XA connection on Microfocus Enterprise server 2.2 but the connection is not getting invoked.

I am able to build and compile my COBSQL program with following directives

CONFIRM CONSTANT DATABASE"ORACLE" p(cobsql) CSQLT=ORACLE8 CST CSP DIS MAKESYN SQLDEBUG VERBOSE KEEPCBL END-C p(cp) CONFIRM LIMITED-SEARCH ENDP ENDP
LITLINK SOURCETABSTOP(4) ASSIGN (EXTERNAL) PROTECT-LINKAGE  FCDCAT INDD(SYSIN 80 R) OUTDD(SYSOUT 121 L) ANIM ERRFORMAT(2) NOQUERY NOERRQ

Here is my Oracle_XA connection detail setup under Server/Resource manager/XA Tab

Enabled ID Name Module Open string Close string Description
DBP1 DBP1 /var/mfcobol/es/TF64BT/SYSTEM/xa/ESORAXA64.so Oracle_XA DB=ORACLESERVERHOSTNAME SqlNet=ORACLESIDNAME ACC=P/USERNAME/PASSWORD SesTM=10 LogDir=/var/mfcobol/es/TF64BT/SYSTEM/xa DbgFl=0x4

Here is details of my LD_LIBRARY_PATH environment varible details

LD_LIBRARY_PATH   /u01/app/microfocus/ent_development/lib:/u01/app/microfocus/ent_development/lib:/u01/app/oracle/product/11.2.0/client_1/lib

 

When I start the server, I can see the XA connection is established correctly, here is log

140731 14055079      10571 TF64BT   JES000042I SSTM not enabled: CICS 14:05:50                                                                                                                                                                                                                     
140731 14055083      10571 TF64BT   CASXO0020I DBP1 XA interface loaded. Name(Oracle_XA), Registration Mode(Static) 14:05:50                                                                                                                                                                       
140731 14055083      10571 TF64BT   CASXO0021I DBP1 XA interface local transaction support enabled 14:05:50                                                                                                                                                                                        
140731 14055088      10571 TF64BT   CASXO0015I DBP1 XA interface initialized successfully 14:05:50                                                                                                                                                                                                 
140731 14055088      10571 TF64BT   CASSI5001I PLTPI Phase 1 - No PLT Specified 14:05:50       

Here is my Program contents

      $SET directives"sql.dir" 
       program-id. ORATEST as "ORATEST".

       environment division.
       configuration section.

       data division.
       working-storage section.
           EXEC SQL INCLUDE SQLCA    END-EXEC.                          
           EXEC SQL BEGIN DECLARE SECTION END-EXEC
                01  W-NAME   PIC X(100).
           EXEC SQL END DECLARE SECTION END-EXEC.

       procedure division.
             
             EXEC SQL
                 select cust_name INTO :W-NAME      from tblcustomer
                     where  customer_id='12345678'
             END-EXEC
             
             DISPLAY 'customer name = ' W-NAME
             DISPLAY 'SQL CODE= ' SQLCODE
             DISPLAY 'SQL STATE= ' SQLSTATE
             DISPLAY 'SQL ERROR MESSAGE= ' SQLERRMC
             DISPLAY '**********'


	     stop run.

 

Here is my JCL to contents

//ORATEST  JOB (ORATEST),CLASS=4,MSGCLASS=J,MSGLEVEL=(1,1)
//*
//*
//*-----------------------------------------------------------------*
//* TEST ORACLE XA CONNECTION *
//*-----------------------------------------------------------------*
//STEP05 EXEC PGM=IKJEFT01
//IEFRDER DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYS(DBP1)
RUN PROGRAM(ORATEST)
END
/*

When I submit my job, I am not getting any output or SQL state. I checked with DBA, and as per him no connection getting established while submitting JCL job

Please advise

 

Thanks in Advance

Anil Varma


#Oracle
#COBSQL
#EnterpriseServer
#oracle_xa

Hello Anil:

The documentation says:

If you want to access Oracle, IBM DB2, XDB, or SQL Server databases from JES JCLs using IKJEFT01, you must build an additional switch module to use along with the standard switch module.

You must also build [the following] additional modules if you need to connect to resources from JES-initiated tasks over IKJEFT01.  These modules must be loaded by the main switch module; therefore include the full path to any additional switch modules in your system's PATH environment variable:

Value of switch-module  Module type
         ora1pc                   Oracle databases

So it's important that, inside /var/mfcobol/es/TF64BT/SYSTEM/xa where you have decided to put ESORAXA64.so, you also build and put ESORAOPC64.so.  When you execute "build ora1pc" to do this, it comes out with a warning saying ESORAOPC64.so needs to reside in a directory that is included on your LD_LIBRARY_PATH.  So I would add /var/mfcobol/es/TF64BT/SYSTEM/xa to your LD_LIBRARY_PATH.  Although actually this seems OK already since the console.log says "XA interface local transaction support enabled", but still this is an area to double-check.

Also, the source code for ESORAXA.CBL includes a part where a person can hard-code the open string by un-commenting and modifying these lines:

        *> MOVE z"Oracle_XA SesTm=100 SqlNet=DNSName Acc=P/uid/passwd"
        *>      TO ws-open-string

Doing so overrides the open string specified on the Server/Resource manager/XA Tab.  Check the source code for ESORAXA.CBL; is this part un-commented?

Also, you're building the XA switch in 64-bit mode -- are the COBOL programs also compiled in 64-bit mode?  Is ES itself running in 64-bit mode?  Is the Oracle database also running in 64-bit?  As an experiment you might try building everything in 32-bit mode.

Also, what type of UNIX/Linux is this?  If it's AIX, then instead of LD_LIBRARY_PATH, you should be specifying LIBPATH.  That's something to check.

Also, is the database really named "ORACLESERVERHOSTNAME", as specified in your open string, or, because you've written it in bold italic, is that just the meta-value?  What is the actual database name?