|
----- Message from "Stone, Joel" <Joel.Stone@xxxxxxxxxx> on Mon, 14mailto:cobol400-l-bounces@xxxxxxxxxxxx
Oct 2013 14:31:24 +0000 -----
To:
"cobol400-l@xxxxxxxxxxxx" <cobol400-l@xxxxxxxxxxxx>
Subject:
Re: [COBOL400-L] XML using COBOL(RPG)?
Not sure if "binary" and decimal s9(5)"v9(2)" makes sense together.
Isnt binary strictly integers (1,2,3...) ? I have never seen
10AC.BD hex before!! - doesn't seem to make sense.
Try removing the "binary" - for testing make it as simple as
possible. Change all to decimal display - not packed, not binary.
-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx [
] On Behalf Of geir.kildal@xxxxxxxxxxtestpgm:
Sent: Monday, October 14, 2013 8:27 AM
To: cobol400-l@xxxxxxxxxxxx
Subject: Re: [COBOL400-L] XML using COBOL(RPG)?
Hi Michael.
I have tried computational, comp-3 and binary def for the receiving
field. I still miss the decimals. Here is the essence of my small
mailto:cobol400-l-bounces@xxxxxxxxxxxx
WORKING-STORAGE SECTION.
01 ws-a pic x(6) value "-25,33". (SPECIAL NAMES. DECIMAL-
POINT IS COMMA. ( I have also tried without it))
01 ws-b pic s9(5)v9(2) binary value zero. (display, COMP-3,
COMPUTATIONAL - they all fail)
PROCEDURE DIVISION.
mainline section.
main-000.
compute ws-b = function numval-c(ws-a). Result: WS-B = -00025.00
compute ws-b = function numval(ws-a). Result: WS-B = -00025.00
go to main-000.
This is according to the manual, and I just can't understand what
I'm doing wrong..
I'm on V5R4.
Mvh. / Regards / Terveisin
Geir
-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx [
] On Behalf Of MichaelQuigley@xxxxxxxxxxwork.
Sent: Monday, October 14, 2013 2:23 PM
To: cobol400-l@xxxxxxxxxxxx
Subject: Re: [COBOL400-L] XML using COBOL(RPG)?
Jon Paris is correct. NUMVAL-C is generally used to convert values
with currency symbols, but I've used it before without them. It should
Where I've often been bit is that NUMVAL and NUMBAL-C both return avalues.
floating point value. Floating point is not precise--at least not
when converted to a fixed-decimal value.
My only suggestion would be to define NUMFIELD as packed-decimal.
You could also try specifying an interim value using greater
precision--at time that helps when converting from floating point
I believe packed-decimal is COMP-3--I prefer specifying"PACKED-
DECIMAL", "BINARY", etc. so that no one is required to remember the
esoteric COMPUTATIONAL identifiers.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.