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




On Jan 25, 9:33 am, "HeyBub" <heybubNOS...@xxxxxxxxx> wrote:
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.


In fact there is a list of allowable control characters. The prediction
is that in those files in that system a null will never occur and tabs,
for example, will be passed to the program in the record area (as
specified in the manual).

http://publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic...


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.

Because, upon reading a line sequential file, certain control
characters, such as tab, line feed and carriage return will be
processed by the file system and will not be passed into the program.
tabs will be expanded and cr/lf will signal the end of record.

If it is required to have these characters passed from one program to
another then the low-values prefix acts as an escape character. The
low value will be dropped and the character following will be passed to
the program as data.

If that behaviour is unrequired then the 'N' switch can be turned off
by a command-line entry or an environment variable (COBSW=-N) or by the
program using called routines to change the setting (as specified in
the manual).

That is to say that 'low-values in line sequential files' may not make
sense on your system, but your system is not the whole world and they
may make sense on other systems.

As it happens I have no use for the nulls in that way and have always
had the N switch off, but that is the reason they are used.

.



Relevant Pages

  • Re: how to display character from 128-159 range
    ... coded graphic characters identified as Latin ... which defined the control characters as well. ... ISO-8859-1 being the Internet standard, ...
    (comp.unix.programmer)
  • Re: Change export delimitor?
    ... Did you hit and hold the control key when you hit the j key? ... "PhillyRon" wrote: ... invisible characters but dec 013 and dec 010. ... "Dave Peterson" wrote: ...
    (microsoft.public.excel.misc)
  • Re: how to display character from 128-159 range
    ... which defined the control characters as well. ... ISO-8859-1 being the Internet standard, ...
    (comp.unix.programmer)
  • Re: Strange PreTranslateMessage Behavior (2)
    ... get rid of all instances of GetDlgItem in your code. ... The correct solution is to create a control member variable; ... Since the keyboard is now trying to send characters ... >keyboard characters no longer show up in PreTranslateMessage and are ...
    (microsoft.public.vc.mfc)
  • Re: Sending Keystrokes
    ... Control keys are problematic with PostKeybdMessage. ... Rick D. ... so that the user can set a suffix of TAB + ENTER, ... except for the control characters. ...
    (microsoft.public.dotnet.framework.compactframework)