OPENCHECK statement

Syntax

OPENCHECK [dict,] filename [TO file.variable] 
{THEN statements [ELSE statements] | ELSE statements}

Description

Use the OPENCHECK statement to open an SQL table for use by BASIC programs, enforcing SQL integrity checking. All file references in a BASIC program must be preceded by either an OPENCHECK statement or an OPEN statement for that file.

The OPENCHECK statement works like the OPEN statement, except that SQL integrity checking is enabled if the file is an SQL table. All field integrity checks for an SQL table are stored in the security and integrity constraints area (SICA). The OPENCHECK statement loads the compiled form of these integrity checks into memory, associating them with the file variable. All writes to the file are subject to SQL integrity checking.

The STATUS Function

The file type is returned if the file is opened successfully. If the file is not opened successfully, the following values might return:

Value
Description
-1
Filename not found in the VOC file.
-21
Null filename or file.
-3
Operating system access error that occurs when you do not have permission to access an InfoSphere® DataStage® file in a directory. For example, this might occur when trying to access a type 1 or type 30 file.
-41
Access error when you do not have operating system permissions or if DATA.30 is missing for a type 30 file.
-5
Read error detected by the operating system.
-6
Unable to lock file header.
-7
Invalid file revision or wrong byte-ordering for the platform.
-81
Invalid part file information.
-91
Invalid type 30 file information in a distributed file.
-10
A problem occurred while the file was being rolled forward during warm-start recovery. Therefore, the file is marked "inconsistent."
-11
The file is a view, therefore it cannot be opened by a BASIC program.
-12
No SQL privileges to open the table.
-131
Index problem.
-14
Cannot open the NFS file.

1A generic error that can occur for various reasons.