Re: Identifting sign in COMP data
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Jun 2007 05:09:31 GMT
Follow up on this and your previous note.
You really are going about this entire process "backwards" (and the hardest way
possible).
If you move your COMP, COMP-3, COMP-4, Binary, and Packed-Decimal fields (on the
mainframe) to
Usage Display - Sign is Separate - fields
and
Move your COMP-1 and COMP-2 fields to "external floating point" i.e.
PIC +9.9(15)E+99
fields
BEFORE you down-load your files (using EBCDIC/ASCII conversion) then you won't
have any of these problems/questions. If you want them in COMP-xxx format on
the Workstation, then simply reverse the MOVE statements of the mainframe
program.
P.S. On the mainframe, A, B, and E *are* valid sign-nibbles for packed fields,
they are just never produced by COBOL - but COBOL can handle them.
P.P.S. On the mainframe, there is a difference between "unsigned" and
"signed-positive" nibbles, this doesn't exist on the workstation.
P.P.P.S. You can only use the "most-significant" bit for deterring the sign of
a Binary fields, if the COBOL program defines it with a "S". If the PICTURE is
unsigned, then that bit is part of the number/data.
--
Bill Klein
wmklein <at> ix.netcom.com
"kimi" <mraghu83@xxxxxxxxx> wrote in message
news:1183006609.523437.181340@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi ppl,
Can anyone tell me how to recognize whether the COMP
variables are negative or positive.
For instance in COMP-3 data , if the last nibble is 'C' then we say it
is positive and if it is 'D' or 'F' we say it is negative.
Similarly how can we recognize whether the number is positive or
negative in COMP , COMP-1 and COMP-2 data.
.
- References:
- Identifting sign in COMP data
- From: kimi
- Identifting sign in COMP data
- Prev by Date: Re: (OT) The desktop supercomputer has arrived!
- Next by Date: Re: Identifting sign in COMP data
- Previous by thread: Re: Identifting sign in COMP data
- Index(es):
Relevant Pages
|
|