Re: Cobol convert program Job Request
- From: jacodeguy@xxxxxxxxx
- Date: 22 Feb 2007 13:00:59 -0800
On Feb 22, 2:06 pm, "Richard" <rip...@xxxxxxxxxxxx> wrote:
On Feb 23, 8:51 am, Louis Krupp <lkr...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
The record matches the layout perfectly!
Micro Focus S9(4) COMP is two bytes binary
and 9V9(4) COMP is three bytes binary.
How do you fit a sign and four digits into two bytes? (Or am I being
unusually dense today?)
In binary (as stated). The value in 16 bit can be -32368 to 32367
which is a larger range than -9999 to 9999.
COMP (in this case) however is byte reversed compared to intel format
being big-endian.
I have some printouts of what the sketch should look like, I cannot
find the first record (pin 01-000-001-00), but I do have the second
(pin 01-000-006-00). Based on looking at the printout, I think the
first part should be like this:
01-000-006-00, A, -40, 16, 1, 11, 13, 33, 13, 49, 31, 49, 31, 53, 47,
53, 47, 27, 23, 27, 23, 33, 13, 33, 0, -2,
C I can do, and would love too, but a little rusty. The bytes and
strings I think I can get out, but I'm not sure about the S9(4) COMP
(two bytes reversed) thing.
if I have:
byte *buffer;
fread(buffer, 2, f);
// lets pretened I just read a comp, you previously said:
// "Just byte switch the COMP fields."
// How would I do that?
int x = (buffer[1] << 16) && buffer[0]; // something like this?
-Andy
.
- Follow-Ups:
- Re: Cobol convert program Job Request
- From: Rick Smith
- Re: Cobol convert program Job Request
- References:
- Cobol convert program Job Request
- From: jacodeguy
- Re: Cobol convert program Job Request
- From: Richard
- Re: Cobol convert program Job Request
- From: jacodeguy
- Re: Cobol convert program Job Request
- From: Richard
- Re: Cobol convert program Job Request
- From: jacodeguy
- Re: Cobol convert program Job Request
- From: jacodeguy
- Re: Cobol convert program Job Request
- From: Louis Krupp
- Re: Cobol convert program Job Request
- From: Rick Smith
- Re: Cobol convert program Job Request
- From: Louis Krupp
- Re: Cobol convert program Job Request
- From: Richard
- Cobol convert program Job Request
- Prev by Date: Re: Cobol convert program Job Request
- Next by Date: Re: Cobol convert program Job Request
- Previous by thread: Re: Cobol convert program Job Request
- Next by thread: Re: Cobol convert program Job Request
- Index(es):
Relevant Pages
|