ContentsIndexPreviousNext

B.8 Acu4GL for Microsoft SQL Server: Common Questions and Answers

Question: I can't seem to get Acu4GL to create the files in Microsoft SQL Server. 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.

Type "wruncbl -vv" and make sure that the version number of the Microsoft SQL Server Acu4GL product is reported. This tells you that the Acu4GL product has been installed successfully. If "-vv" does not return the Microsoft SQL Server 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.

Question: Can I use both Microsoft SQL Server and Vision at the same time?

Answer: Yes, you can. In the runtime configuration file, set DEFAULT_HOST to the file system you want the runtime to use automatically. Then, for selected files, assign them to an alternate file system with the variable filename_HOST. For example, to put CUSTFILE into Microsoft SQL Server and everything else into Vision, you would add:

     DEFAULT_HOST  Vision
     CUSTFILE_HOST  MSSQL

Question: How can I find out what the Microsoft SQL Server error message is?

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

If you have sent the errors to an output file with the "-e" option, the runtime also attempts to include the text that explains the errors. See section B.7.1, "Acu4GL for Microsoft SQL Server: Runtime Errors" for additional details.

You can also retrieve error codes from within your COBOL program by using the library routine C$RERR. See section B.7.1, "Acu4GL for Microsoft SQL Server: Runtime Errors" in this appendix 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 run time, 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 Microsoft SQL Server reserved word. Locate the column by comparing a file trace of the CREATE TABLE to Microsoft SQL Server'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 Microsoft SQL Server automatically determines an owner, you can 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: 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, use the FILE directive to provide a base name for the XFD. Suppose you provide CUST as the base. The compiler then generates 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, 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 products linked into the runtime.

Question: Are there any ACUCOBOL-GT library routines that do not work with or would not make sense to use with Acu4GL for Microsoft SQL Server?

Answer: Yes. There are two ACUCOBOL-GT library routines that either don't work with or do not make sense to use with Acu4GL for Microsoft SQL Server: C$COPY and C$RECOVER.