Informix Error -4830: The variable var_name is not of type INTEGER or SMALLINT. It cannot be used as a file descriptor.
Cause and resolution
The variable var_name is not of type INTEGER or SMALLINT. It cannot be used as a file descriptor.
The variable used as a file descriptor must be an integer type. Specify a different variable, or redefine the one named.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4830 fires when a variable used as a file descriptor isn't declared INTEGER or
SMALLINT — per the official guidance.
- A non-integer-type variable used to hold a file descriptor, per the official guidance — the direct, only cause.
Solutions / Resolution
- Specify a different variable, or redefine the one named, per the official guidance,
as
INTEGERorSMALLINT.
Examples
A non-integer file descriptor variable
DEFINE fd CHAR(10)
CALL f.open(fd, "orders.dat")
-- -4830: fd must be INTEGER or SMALLINT
Corrected
DEFINE fd INTEGER
CALL f.open(fd, "orders.dat")
Diagnostic Checks
- Check the declared type of every variable used as a file descriptor, and change it to
INTEGERorSMALLINTif it isn't already.
Related Errors / Related Topics
- -4831 — "The variable var_name is not of type INTEGER or SMALLINT. It cannot be used to store offset bytes returned from the seek operation." The same underlying type restriction, for a seek-offset destination variable rather than a file descriptor.
- -4823 — "The file associated with the file descriptor may not be opened." A related file-descriptor error, about the descriptor's open/closed state rather than its variable type.
A variable used as a file descriptor isn't INTEGER/SMALLINT — redefine it as one.