I've been trying to make use of some very old data, and again, all I
have is COBOL. I hope some could help me out here.
COBOL TEST
Using a test database, with one dataset that has four fields, defined
as R4, R2, E4, E2, I entered the same exact value ( -987654321.05 ) into
each field using Query.
Can anyone point me in the right direction as to why I am not getting
the -987654321.05 returned.
Using COBOL
COBOL X8 Image R4
CALL INTRINSIC "HPFPCONVERT" USING
X8R4V18-Realr4, X8-IEEE, 2, 4, STATUS-WORD, EXCEPTIONS.
CALL INTRINSIC "HPINEXT" USING
X8-IEEE, -2, 42, 18, -3, 0, String-Amount, ERR
String-Amount: [-987654321.04999989 ]
Does NOT get better with the R2 item.
COBOL X4 Image R2
CALL INTRINSIC "HPFPCONVERT" USING
X4R2V18-REALR2, X4-IEEE, 1, 3, STATUS-WORD, EXCEPTIONS
CALL INTRINSIC "HPINEXT" USING
X4-IEEE, 1, 42, 18, -3, 0, String-Amount, ERR
String-Amount: [-98765.0625 ]
COBOL X8 Image E4 : [-987654321.04999989 ]
COBOL X4 Image E2 : [-98765.0546875 ]
The same program works perfect with small positive amounts, like
456.50. The R4, R2, E4, and E2 all are returned as 456.5.
--
Michael Anderson
Programmer/Analyst -- Technology Dept.
Spring Independent School District
16717 Ella Boulevard
Houston, Texas 77090-4299
office: 281.586.1105
Mobile: 832.515.3868
fax: 281.586.1187
-
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|