Help!--ASCII vs MVS / Unpacked Signed Fields
Posted in 1995
Hi People, You'll never believe the problem I've encountered now. I have an Informix 4gl program which generates a report to a flat file, which subsequently has to be FTP'd to an MVS box for further processing. In this file I supply an "amount_charge" field w/ an implied decimal (ie, $974.00 looks like 00097400). My problem is with credit charges...where the amount is a negative number. The requirements on "the MVS side" call for using a "sign character" as the last byte, and these characters range from "J" for 1, to "R" for 9. Thus, if my amount_charge is -$768.81, I would supply 0007688J. Hope this makes sense! I've written a little routine which converts this last digit--this is no problem. My problem is a last digit of zero. In the "grand scheme" of the EBCIDIC world, a zero translates to the ASCII char of 208, AKA hex D0. Thus, for a negative charge of -$954.00, I would supply 0009540X (where X simply represents the 'unprintable?' char of ASCII 208 in this case). Alas, I thought I could use the ASCII function to assign this char to a variable and print it (for which it does in the report). However, after batch processing on MVS, I'm getting $954.07 instead of $954.00...where did the 7 cents come from????? Has anybody encountered this before? Is there a *simple* solution here w/o re-writing the MVS batch program? (I think I've done as much as I could from "my end" ! :-) Thanks a bunch, STEVE ____ ___ ________ ________ /_ _] /_ ]/ ______)/ ______) _/| Steve Morrow, Coordinator / DBA / _/ / / / (____ / /___ _/ | University of South Florida / _/ / / \\____ ) / _____) _/ | Internet: smorrow@dotrisc.cfr.usf.edu / _/___/ / ______/ / / / _/ | Voice : (813) 974-6889 (_________)(________)(___)______/ |______________________________________