Created On:  01 October 2009

Problem:

The runtime routine CBL_DIR_SCAN_READ returns a value of 127 which is not a file status code as described in the Net Express help.

Resolution:

Here are 4 possibilities to get the returncode 127 in CBL_DIR_SCAN_READ even the CBL_DIR_SCAN_START returns 0 (o.k.) (there might be more…):

1. When wildcards are used in CBL_DIR_SCAN_START the appropriate FLAG must be set in CBL_DIR_SCAN_START.
2. When quotes are used to specify the search pattern in CBL_DIR_SCAN_START (see: KB 1444).
3. When pattern-length in CBL_DIR_SCAN_START does not specify the real length of the pattern but e.g. the length of the buffer, it might cause a 127.
4. When the handle in CALL ā€œCBL_DIR_SCAN_READā€ is not passed BY REFERENCE.

See the attachment for a demo.
Incident #2355833