[See all pages on this site.] [Find out more about Trifox Inc.] [Find out how to contact Trifox personnel.] [Complete product documentation, FAQs, online references.] [Pricing is simple.] [Download an evaluation copy of any Trifox product.] [Descriptions of all products, including VORTEX, DesignVision, and Genesis.]

[LOGO]
[Navigation Map]

 

[Search Site]

| 

Using VORTEXcobol

How can I open and specify multiple DBMS connections within an embedded SQL COBOL?
To maintain more than one active connection in a precompiled program, you must identify the connections:
exec-sql declare mysql database end-exec.
exec-sql declare mydb2 database end-exec.
Then when you connect, you specify which connection you are starting:
 
  MOVE "net:sa/sa/master2/myserv@1958:mysqlipaddr!c:\\vtxbin\\vtx12" to
    SQL-LOGIN.
  exec-sql at mysql connect to :SQL-LOGIN end-exec.
  MOVE "net:dbuid/db2pwd/dbname@1958:mydb2ipaddr!/vtxbin/VTX7" to
    DB2-LOGIN.
  exec-sql at mydb2 connect to :DB2-LOGIN end-exec.
All other SQL statments must be prefixed with the name of the DB connection, for example
exec-sql at mysql open C0 end-exec.
exec-sql at mysql fetch C0 into :BLAH1, :BLAH2 end-exec.
exec-sql at mydb2 fetch C2 into :ETC1, :ETC2, :ETC3 end-exec.

We are currently using Vortex with AcuCobol to access our Informix database. The dates within Informix are formatted as MM/DD/YYYY. When reading these dates using Vortex, they change to the default mask of DD-MON-YY. I read about the format masks, VTXOPT() and conversion routines (specifically TCVD2S) but couldn't find any sample documentation on how any of these might be used.
 
Basically, I would like to be able to keep the Informix date format of MM/DD/YYYY but am not sure what the code would look like for this or what is the best method. Any suggestions or samples?
You need to change the TDB_DTF field in the TDB_OPTS structure. The structure is defined in vortex.h:
typedef struct tdb_opts {
          i4         TDB_DTB;               /* datetime base                  */
          chad       TDB_DTF[64];           /* datetime format                */
          i2         TDB_NMK;               /* NULL mask                      */
         } TDB_OPTS;
This is the buffer that VTXOPTS() is expecting as the second parameter. The default TDB_DTF is "DD-MON-RR". The simplest is to call VTXOPTS(1,buffer) to load your buffer, modify TDB_DTF to "MM/DD/YYYY", and then call VTXOPTS(0,buffer) to send it back to VORTEX. i4 is a four byte integer, chad is a character, and i2 is a two byte integer.

I have downloaded the VORTEXserver and the VORTEXcobol precompiler. But when i try to precompile a programm with "vtxcob js001.cobpc -ma", the following message comes up:
***** FATAL (line 1): Error message file not available. ERRNO: 3
Make sure that there is a file gerror.msg in your %TRIM_HOME%\lib directory.

Our programs have been written to use a host variable date field in the format of YYYYMMDD. It is currently retrieved and loaded during the I/O. Do you see a problem with the Vortex COBOL precompiler or runtime loading the PIC X(08) field in this format?
This should not be a problem if you're only reading the data. However, depending on the database, you may be required to call some of our conversion routines to update a date column. Every DBMS has a different default date format for strings and your program will have to make certain that it uses the correct format.

Also, all of our numeric host variables, for example, are defined as pic s9(9) comp-3 or pic s9(13)v99 comp-3. Do you see any problem with the Vortex product attempting to loading these host variables from the various numeric database data types use by the differing vendors?
We support comp-3, this should not be a problem

Our development platform is currently Oracle and SCO Unix and HP and Informix but we intend to try to use your product initially to deliver a Windows Server and SQL Server implementation.
This should not be a problem either, we support all of the mentioned platforms.


© 1985-2013 Updated 6 Sep 2011.