contents.gifindex.gifprev1.gifnext0.gif

Sybase: Common Questions and Answers

Question: I can't seem to get Acu4GL to create the files in Sybase. They keep coming up as Vision files.

Answer: 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.

Use the runtime's -vv option and make sure that the version number of the Sybase interface is reported (for example, if your runtime were named runcbl, you would type runcbl -vv). This tells you that the interface has been installed successfully. If -vv does not return the Sybase interface 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 interface version number using -vv, you will have to create one by re-linking the runtime.

If you need to do that, make sure that USE_SYBASE is set to 1 in the file filetbl.c before you re-link.

Question: What files do I need in order to link my C routines into Acu4GL?

Answer: From your ACUCOBOL-GT runtime media you need:

sub.c
sub85.c
filetbl.c
config85.c
direct.c
sub.h

(UNIX only)
all files in the lib subdirectory
of your ACUCOBOL-GT distribution

(Windows 95/98/NT only)
mswinsub.c
wruncbl.lib or wrun32.lib
wacuterm.lib
acuuser.libj

From your Acu4GL media you need:

sybase.o (or syb04_32.obj or syb10_32.obj
on Windows and Windows NT)
syb_make.in
syb_inst
syb_inst.in
syb_cfg.in

From Sybase you need the platform-specific Open Client DB-Library/C product.

Instructions for linking are given in the installation portion of this section.

Question: How can I find out what the Sybase error message is?

Answer: If you run your application with the -x option, you will receive secondary error numbers that include those returned by Sybase, in addition to the ACUCOBOL-GT error.

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. See topic Sybase: Runtime Errors , for additional details.

You can also retrieve error codes from within your COBOL program by using library routine C$RERR. See Sybase: Runtime Errors , for additional details.

Question: Do my XFD files have to be in the same directory as my object files?

Answer: No. You can instruct the compiler to put the XFD files in a directory other than the current one with the -Fo option, or you can move the XFD files after they're created. Then at runtime, make sure you have the runtime configuration file variable XFD-DIRECTORY set to that same directory.

Question: Why aren't my keys being retrieved in the correct order?

Answer: You may have illegal data in the field. For example, if you've used LOW-VALUES or HIGH-VALUES in a numeric key to mark control records, those values are considered invalid and can cause the records containing them to be retrieved in an unexpected sequence.

Signed numeric data in key fields can also be a problem; the records may not sort, or be retrieved, in the same sequence as under the Vision file system.

To enable special values such as these to be processed, use the BINARY directive in front of the key field. This will allow 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.

Question: When I try to open a file for output, I get the error 9D,2714 There is already an object named * in the database. Why?

Answer: One of your record's data items probably has the same name as a Sybase reserved word. Locate the column by comparing a file trace of the CREATE TABLE to Sybase's list of reserved words. Apply the NAME directive to the field in the FD that is associated with the invalid column, then recompile the program to create a new XFD file.

Question: Can I open tables in different databases?

Answer: Yes. Use a file name like:

database.owner.tablename

Note that, because Acu4GL for Sybase will automatically determine an owner, you could also specify a file name like database..tablename. The two dots are mandatory in this case.

Question: Can I use multiple servers (on the same machine or on different machines) on my network?

Answer: Yes. Each server has a unique name. To see if the necessary setup has been done, enter:

isql -S servername

If this connects you to the server you want, then you can open tables on that server by giving them a name like servername.database.owner.tablename. Note that this naming can be done in your runtime configuration file.

Question: I'm getting an error 9D,11 ACUCOBOL-GT lock table missing. I know that I added the lock table during installation.

Answer: This is probably a permissions problem. All users must have READ, WRITE, UPDATE, and DELETE access to AcuLocks (and therefore to the database that contains it). Be sure to check your permissions.

Question: I keep receiving an error message saying that my login is invalid. But I'm sure I'm using the correct username and password.

Answer: All usernames, passwords, and database names are case sensitive. Be sure that you are typing the names exactly as they are set up.

Question: The runtime system can't seem to locate my XFD file, but when I check the XFD directory, the file is definitely there.

Answer: Check the case of the XFD filename. The interface may be looking for upper case on the base name.

Question: 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.

Answer: At runtime, 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 (CUST0001, CUST0002, CUST0003, etc.). It's not necessary to have a separate XFD for each file, so long as their record definitions are the same.

The individual files can all be mapped to the same XFD via a runtime configuration variable called 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 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 runtime configuration file:

XFD-MAP CUST* = CUST

The asterisk (*) in the example is a wildcard that matches any number of characters. Note that 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 Acu4GL interfaces linked into the runtime.

This is the end of the Acu4GL for Sybase section. Click the Contents button at the top of this window to return to the Table of Contents page.