If the shipping method is "FX," the customer gets next-day shipping, otherwise shipping takes two weeks. The logic should be easy to follow, even if you've never seen COBOL code before. Here's an example of the problem code, which tries to compute the shipping charge and expected shipping date for an order: 1 identification division.Ĩ 01 shipping-method pic x(2) value 'US'.ġ0 01 normal-ship-date-yyyymmdd pic 9(8) value 20170522.ġ1 01 nextday-ship-date-yyyymmdd pic 9(8) value 20170508.ġ3 01 shipping-charge pic 99v99 value 4.99.ġ7 move normal-ship-date-yyyymmdd to expected-shipping-dateġ9 move nextday-ship-date-yyyymmdd to expected-shipping-date. This is a story of how a punch card ate my program. But COBOL does have its quirks, many of them rooted in the computing environments of the early days of programming. In fact, it's quite good at handling currency and fixed-format records. I worked for 10 years as a COBOL programmer, and I don't think it's quite as bad as its reputation would lead one to believe. It processes an estimated 85% of all business transactions, and 5 billion lines of new COBOL code are written every year. It is routinely denigrated for its verbosity and dismissed as archaic. COBOL is the Rodney Dangerfield of programming languages-it doesn't get any respect.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |