Turn off null insertion in line sequential files

0 Likes

Problem:

By default, characters whose hex values are less than X'20' will have a null byte (X'00') inserted before each such character.  This allows the Micro Focus file handler to read such characters correctly when the file is read, but it may cause compatiiblity issues with files used by other programs.

Resolution:

If null suppression is desired, despite possible read issues with the Micro Focus file handler and some other programs, there are four ways to turn off the feature:

1.  Use the INSERTNULL=OFF option in the file handler configuration file.  See reference manual "File Handling" for details of using a configuration file and the INSERTNULL option.

2.  export COBSW=-N.  However, if there is an active configuration file with INSERTNULL=ON, the COBSW setting is ignored.

3.  Call X'91", function 47.  See reference manual "Library Routines", "Alphabetical list of library routines" for details.

4.  Establish addressability to the File Control Descriptor (FCD) of the correct FD name and set bit 1 of FCD-STATUS-TYPE to zero.  See reference manual "File Handling", "File Handler and Sort APIs" for details of direct FCD access.

The attached tar file contains a demonstration of all four methods.  There is a program, nonulls.cbl, an optional subroutine, parsfhc.cbl, a sample configuration file, myconfig, and a demonstration script, nulldemo.

Untar the file, nulldemo.tar, to an empty directory.  Run the script as-is.  You will be put into vi in read-only mode looking at the demonstration output.

To animate the program, comment out the line "export COBSW=-A" in the script.  To use the optional subroutine (parse the file handler configuration looking for the target option), uncomment the call in nonulls.cbl which follows the word "Optionally" in a comment.

Attachments:

nulldemo.tar

Old KB# 4535
Comment List
Anonymous
Related Discussions
Recommended