Re: Reading in file containing Low Values doesn't work correctly



Richard wrote:
On Jan 25, 3:44 am, "HeyBub" <heybubNOS...@xxxxxxxxx>

Low-values doesn't really make sense in a LINE SEQUENTIAL file. I
wouldn't be surprised if the results were unpredictable.

The results are entirely predictable, but the prediction needs to be
based on what the appropriate manual states will occur.

In the case of MicroFocus the default behaviour is that when writing a
line sequential record it will be processed and all control characters
will be prefixed by a null (which is the default 'low-value'). On
reading, the null is used as a signal the the next character is a
control character that needs to be preserved. This allows a file to be
written and read that will contain control characters (eg tab, line
feed).

In the case in point the nulls are being seen as guard characters and
are dropped, except where two nulls in a row the second is retained.

To change this behaviour set the 'N' switch to off (-N).

Reading the manual makes the behaviour predictable.

Here's another prediction:

"Line-sequential files are files that reside in the hierarchical file system
(HFS) and that contain only printable characters and certain control
characters as data."

Note the "... only printable characters..." qualifier. Low-values is not
printable, nor is it a normal control character like TAB or Linefeed.

http://publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/com.ibm.entcobol3.doc/tplsq01a.htm

Why a file system (like the one you mention) would go to the trouble of
adding LV bytes only to remove them later is a mystery and evidence of
carrot eating. If the file system can detect a control character for the
purpose of preceeding it with a LV byte, why does it need the LV byte to
identify the very same character when it reads the file?

Yep, definite carrot eating.


.