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




<Timofmars@xxxxxxxxx> wrote in message
news:1169580408.070895.174960@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm trying to read in a line sequential file in my COBOL program on my
NT machine. The file is a db2 delimited export file, which is basically
a plain text file.

Two of the columns that are exported contain Low Values. I can verify
that they are low values in the exported data file by looking at the
hex values in an editor.

The data looks something like this:

123456~LL~L~ABCD

The tildes (~) are my delimiters. I'm representing the Low Lalues with
an (L). So this is 4 columns being exported, the first column
containing 123456, the next containing 2 low values characters, the 3rd
containing 1 low value character, and the final column containing ABCD.

The problem is that when I open then read the file into my COBOL
program, what it reads in looks like this:

123456~L~~ABCD

Why didn't it read all the low values? It didn't even replace them with
a space... It just ignored them as if they didn't exist. Although it
did manage to read one of the low value characters, but not the other
2. Any idea what the problem is? I'm just reading the line into a PIC X
(8000) field. I animate the process and I'm able to see what it reads
in immediately after the read statement. I'm also absolutely sure that
I'm reading in the correct file, because any changes in other data do
show up in the animator.

You have not identified what product and version
you are using. Since you mention "animator", I will
assume Micro Focus.

I prepared a record, as you described, for a line
sequential file.

I wrote a program to read the record converting
any low-values read to "L", displayed the record,
and saw the same as you called a problem.

I then ran the program using the runtime switch (-N)
and saw the results you seem to want.

I do not know if we are using the same product; but
if the runtime switch (-N) is available in the product
you are using, you might try it.



.



Relevant Pages

  • Re: Little C Help Please
    ... characters to read, so it hapily goes on reading even when the buffer ... represent the size of the buffer, and stops reading before that number ... I think the OP's problem was not a space in the input, but a newline ... Dig the even newer still, yet more improved, sig! ...
    (comp.os.linux.development.apps)
  • Re: Little C Help Please
    ... characters to read, so it hapily goes on reading even when the buffer ... represent the size of the buffer, and stops reading before that number ... I think the OP's problem was not a space in the input, but a newline ... Dig the even newer still, yet more improved, sig! ...
    (comp.unix.programmer)
  • Re: Whats the weirdest human language?
    ... you learn to match up combinations of two or more characters to recognize a word so that you can then pronounce it. ... He gets the meaning from context and doesn't give a fig what the pronunciation is. ... it becomes a logic puzzle that bears very little resemblance to reading. ... Japanese and Chinese people have both told me that they do this constantly while reading, and they can't understand why Westerners have such a problem reading words that they can't say. ...
    (talk.origins)
  • A Song of Ice and Fire - My Impressions (no spoilers)
    ... I just finished reading book 3 of the George R. ... Swords" straight through. ... I've just finished "A Storm of Swords," today being Feb 15th. ... The characters are detailed individuals, ...
    (rec.arts.sf.written)
  • Re: Whats the weirdest human language?
    ... you learn to match up combinations of two or more characters to recognize a word so that you can then pronounce it. ... it becomes a logic puzzle that bears very little resemblance to reading. ... The second is that sometimes I can figure out what the word means, but cannot come up with a pronunciation from any source at hand ... ... Japanese and Chinese people have both told me that they do this constantly while reading, and they can't understand why Westerners have such a problem reading words that they can't say. ...
    (talk.origins)