Robert:

A life time ago I used to work for a bank and they had bought an online system for savings. What was really fun was that they did not save any signs for any of the numbers in the system. it was all assumed to be positive.
Likewise the dates and other fields were all packed unsigned.
We had one (that I can remember of) sacred programs and that did interest calculations. No one was allowed anywhere near the program (we could look but not touch even that was looked over with interest if you asked to look at it. BTW all programs were assembler. I don't even think the name & address program was COBOL as it needed to massage the various numeric fields. My memory is iffy here but we did run into an issue with sort (before it became DFSORT). The sort control cards said PD and it choked after we upgraded the sort and two months later the sort choked. The alarms went off and only one time since have I seen more VP's in the computer room.
The fix was (if memory serves me)  change the sort control card to BI.

Ed

On Jul 15, 2012, at 12:12 AM, Robert A. Rosenberg wrote:

At 10:22 -0600 on 07/14/2012, Steve Comstock wrote about Re: COBOL packed decimal:

I think he's saying keep amounts in pennies as binary fields.
Convert to dollars + decimal point + cents when you display
these fields.

That works for addition and subtraction. It gets more complex when you need to do multiplication (such as computing interest). That involves shifting and rounding after the multiplication. IOW: To do 6%, multiply by 6 and then shift 2 positions to get back to pennies (after adding 50 to round up/down).

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to