An interesting feature


I recently downloaded a copy of IBMs VisualAge PL/I and used it to write a few short programs. I took classes in PL/I programming as an undergraduate, and I was probably curious if PL/I was anything at all like I remembered it.

After installing the VisualAge IDE, I looked through some of the documentation that came with the software. I was surprised to learn that PL/I had built-in capabilities for handling sterling data. That's right -  the currency used in the UK before they moved to the current decimal pounds and pence system. Before February 15, 1971, one pound was equal to 20 shillings, and one shilling was equal to 12 pence, so that there were 240 pence to one pound. PL/I could actually handle this type of data.

This 1:20:12 system can be traced back to the one introduced by Charlemagne, who introduced this system of currency to the Frankish Empire in around AD 800. (He might also be the one responsible for requiring that IETF standards be in ASCII text, but there's little historical evidence to support that particular claim.)

Charlemagne's system was based on one pound of silver called a livre, or livre carolienne. A livre was then divided into 20 sous, each of which were divided into 12 deniers. It's not clear why Charlemagne chose this particular system of currency, but it became popular enough to be adopted by King Offa of Mercia, a contemporary of Charlemagne. Offa replaced the older sceattas, which were apparently not very standardized, with this new system. Maybe Offa though that a confusing standard was better than no standard at all. It eventually spread throughout the UK.

In any event, I learned that PL/I supports sterling data. You indicate this by following fixed-point data with an 'L.' So if you have this:

declare a, b, c fixed(5,2);

a = 2.4.6L; /* 2 pounds, 14 shillings, 6 pence */

b = 3.6.9L; /* 3 pounds, 6 shillings, 9 pence */

c = a + b;

you'll find that c is set to 6 pounds, 1 shilling, 3 pence. According to the PL/I reference manual that I looked at, all sterling data is converted into pence internally and just displayed as sterling as needed. This may not be the most useful feature of a programming language that I've ever seen, but it's certainly one of the most unusual. I wondered exactly how this came to be part of the PL/I language until I imagined the following discussion:

Customer: "We really need an easy way to handle sterling data. What's the best way to do that?"

Software salesman: "If you buy this product, I'll see that that our next release handles sterling data."

Customer: "OK."

Does anyone have a better explanation of how PL/I came to handle sterling data?

Leave a Reply

Your email address will not be published. Required fields are marked *