Informix Error -1361
Cause and resolution
Illegal TEXT or BYTE file name. Null names are not permitted.
The BYTE or TEXT variable has been located in a file using the 4GL statement LOCATE. However, the filename that is given for the variable is a null string. Because the file does not exist, 4GL cannot do anything with it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1361 fires when a LOCATE statement is given an empty string as the target filename for a
BYTE/TEXT variable — per the official guidance, a file can't exist with a null name.
LOCATEgiven an empty string for the filename, per the official guidance — the direct, only cause, typically from an unset or uninitialized variable supplying the filename.
Solutions / Resolution
- Supply a genuine, non-empty filename to
LOCATE, per the official guidance. - Check the source of the filename variable for why it evaluated to an empty string, if it wasn't a literal.
Examples
LOCATE with an empty filename
DEFINE v_filename CHAR(50);
LOCATE v_text_var IN FILE v_filename;
-- -1361: v_filename was never assigned, so it's empty
Corrected
LET v_filename = "/tmp/staging.txt";
LOCATE v_text_var IN FILE v_filename;
Diagnostic Checks
- Check the value of the filename variable/expression passed to
LOCATEat the point of failure.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -1361 in this set yet.
LOCATE was given an empty filename — check the source of the filename variable.