Here are some answers to common questions that can apply to any relational database management system (RDBMS) data source
supported by the Database Connectors™ family of interfaces.
- I can't seem to get Acu4GL to create the files in my database or ODBC data source. They keep coming up as indexed files.
- Check to see that the
DEFAULT_HOST variable is set in the runtime configuration file or the environment. Setting
DEFAULT_HOST in the environment overrides the setting in the runtime configuration file.
Enter one of the following commands, depending on your operating system.
For UNIX systems:
runcbl -vv
For Windows systems:
wrun32 -vv
to make sure that the version number of the Acu4GL interface for your RDBMS is reported. This tells you that the Acu4GL product
has been installed successfully.
Note: In Windows environments, if
-vv does not return the Acu4GL product information, make sure the runtime has the name you used and is the first so-named executable
on the PATH, and that the
.dll is in the same directory. If you are running Acu4GL for Sybase, and
-vv does not return the Sybase Acu4GL product information, make sure the linked runtime has the name you used and is the first
so-named executable on the PATH. If you cannot locate a runtime that displays a Sybase Acu4GL product version number using
-vv, you must create one by re-linking the runtime. If you must do that, make sure that
USE_SYBASE is set to
1 in the file
filetbl.c before you relink.
- Can I use both an RDBMS or ODBC data source and Vision at the same time?
- Yes, you can. In the configuration file, set
DEFAULT_HOST to the file system you want the runtime to use automatically. Then, for select files, assign them to an alternate file system
with the variable filename_HOST. For example, to put CUSTFILE into a specified RDBMS and everything else into Vision, you
would add:
DEFAULT_HOST Vision
CUSTFILE_HOST name_of_file_system
where
name_of_file_system is one of the following: Oracle , MSSQL, ODBC, Sybase, Informix, or DB2.
- How can I find out what an error message is?
- If you run your application with the
-x option, you will receive extended error numbers that include those returned by your RDBMS or ODBC application.
Note: For Informix, two types of errors are returned: the Informix error and the ISAM error. For Oracle, the error code must include
five digits. If your error code does not already include five digits, you must add leading zeros to complete this requirement.
For example, if your error code is code number 150, the syntax for this option would be OERR ORA 00150.
If you have sent the errors to an output file with the
-e option, the runtime will also attempt to include the text that explains the errors. You can also use the C$RERR library routine.
You can also retrieve error codes from within your COBOL program. See the example in
Retrieving Runtime Errors.
- Do my eXtended File Descriptor (XFD) files have to be in the same directory as my object files?
- No. You can instruct the compiler to put the XFD files in an alternate directory with the
-Fo compiler option. Then at run time, make sure you have the configuration variable
XFD_PREFIX set to include that same directory. See
Compiler and Runtime Options for information on the
-Fo option and the
XFD_PREFIX configuration variable.
- Why aren't my KEYs being retrieved in the correct order?
- If your KEY field is numeric or alphanumeric, you may have illegal data in the field. For example, if you've used LOW-VALUES
or HIGH-VALUES to mark control records, those values are considered invalid and can cause the records containing them to be
retrieved in an unexpected sequence.
To enable special values such as these to be processed, use the BINARY XFD directive in front of the key field. This allows
data of any classification to be processed. Either designate an individual field as binary, or specify USE GROUP, BINARY in
front of a group of fields.
The method of storing variables declared as binary is database-specific. For example, for Oracle databases, variables declared
as binary are stored as raw fields. Refer to your database documentation for information specific to your data source or RDBMS.
- Is it possible to use the same XFD file for data files with different names, if they all have the same structure? This would
be useful when I create several customer files that use the same record definitions.
- At run time, it is possible to use a single XFD for files that have different names. For example, suppose a site has customer
files that have identical structures but different names (such as
CUST0001,
CUST0002, and
CUST0003). It's not necessary to have a separate XFD for each file, as long as their record definitions are the same. The individual
files can all be mapped to the same XFD via the ACUCOBOL-GT runtime configuration file variable
XFD_MAP. Here's how it works.
Suppose your COBOL application has a SELECT with a variable ASSIGN name, such as "customer-file". This variable assumes different
values (such as CUST0001 and CUST0002) during program execution.
Before compiling the application, you would use the FILE XFD directive to provide a base name for the XFD. Suppose you provide
"CUST" as the base. The Compiler would then generate an XFD named
cust.xfd. (The Compiler always converts XFD names to lower case.)
To ensure that all customer files, each having a unique name, will use this same XFD, you make this entry in your configuration
file:
XFD_MAP CUST* = CUST
The asterisk (*) in the example is a wildcard that matches any number of characters. The extension
.xfd should not be included in the map. This statement would cause the XFD
cust.xfd to be used for all files whose names begin with CUST.
The
XFD_MAP variable has this syntax:
XFD_MAP [pattern = base-xfd-name] ...
where
pattern consists of any valid filename characters and may include "*" or "?". These two characters have special meanings in the pattern:
*
|
matches any number of characters
|
?
|
matches a single occurrence of any character
|
For example:
CUST????
|
matches CUST0001 and CUSTOMER;
does not match CUST001 or CUST00001
|
CUST*
|
matches all of the above
|
CUST*1
|
matches CUST001 and CUST0001 and CUST00001;
does not match CUSTOMER
|
*OMER
|
matches CUSTOMER;
does not match CUST001 or CUST0001
|
The
XFD_MAP variable is read during the open file stage of any Database Connector used with the run-time system.
- I'm unsuccessful in trying to create a table in MSSQL Server, and when I check the trace log, I find the following "File Error:9k":
-
ssinit_connection sss
Trying to open a connection to server
MyBadServer
report_status called from 1176
[1] 08001 17 – [DBNETLIB]SQL Server does not exist or access denied.
[2] 01000 53 – [DBNETLIB]ConnectionOpen (Connect()).sssssss
Where
MyBadServer is the value set in the configuration file for
A-MSSQL-DEFAULT-CONNECTION.
You might be using the wrong server name in the
A-MSSQL-DEFAULT-CONNECTION variable. One way you can verify the server name is by following the steps below. This method is useful if you don't have
the client tools for SQL Server installed.
- Create a new ODBC Datasource for SQL Server.
- When prompted for the server name, select your local server from the drop-down list of available servers.
- Connect to this server using ODBC Administrator.
This will provide you with the name of the server you need to use in the
A-MSSQL-DEFAULT-CONNECTION variable.