Why you should consider using PL/I:
* It is an easy language to use; the syntax is clean, and the rules are
uniform. There are many built-in functions to assist.
* It is a good first language, and provides an excellent growth
path for the professional.
* PL/I can be used for solving a wide range of numerical problems in
virtually every sphere of the computing arena, be it mathematics,
engineering, science, medicine . . . etc
1. The best part of PL/I is the input and output. You can rely on it.
The input/output is achieved with statements that are ready to use,
and easy to use.
There's no setting up to do. They are <b>not</b> procedures or functions
dressed up to look like statements.
In formatted output, you don't get silly numbers displayed when
you include the format specification, but omit the name of the
variable (e.g. C); nor when you use the wrong format (e.g. I4
with a fortran REAL variable). PL/I converts to/from the type
that you specify, be it integer, fixed-point, or string.
You don't get silly things happening because you left off the
"&" from the "scanf" function in C. That's because the input
operation (GET) is a statement, not a function.
And when you want formatted output, you have a variety of formats
that you can choose, such as PICTURE format, with drifting signs
and drifting $ sign. You can insert commas or spaces in very long
numbers, to make the output readable (e.g. 123,456,789.356,251 is
better than 123456789.356251). You can use either PICTURE formats
or the specific codes to get integer, decimal fixed-point, and
And if you don't want to be bothered with formats, you can use
simple free-formatted output, e.g. PUT (X);
2. For business applications, you can have decimal data, whereby
data is stored exactly (e.g. 5.14 is stored EXACTLY, not as
5.13999), and arithmetic operations give exact results
(e.g. 3 x 5.14 gives you 15.42 precisely, not 15.41998)
3. Files are easy to use. If you can do output to the screen, and input
from the keyboard, you can do Input/Output to files, simply by inserting
the file name into the GET or PUT statement thus: GET FILE (MYDATA) etc.
Outstanding and helpful PL/I facilities include:
1. The debugging facilities are all part of the language (for example,
checking for subscript bound errors and string reference errors
with SUBSCRIPTRANGE and STRINGRANGE etc are most helpful, along
with appropriate ON statements to display the values of variables).
The best part of this is that you can display everything you need
(statement number, values of variables, a trace of procedure calls, etc)
instead of those cryptic messages (from other languages) such as
"floating-point trap" at some inidentified location somewhere in
the program. (When you've had this message in a 20,000 line program,
you'll know what I mean!)
2. And if your program gets stuck in a loop, just hit CTRL-BREAK,
and your ATTENTION ON-unit will tell you precisely which
statement it's executing. Not only that, it lets you do anything you want,
including printing the values of all (or preselected) variables,
and changing any or all of the values of variables.
You don't have to re-run your program (with new output
statements) to find out in which loop it's stuck! (and then run it
yet again to display the values of variables you think you need).
And if your program was running OK after all, you can resume
execution again, as if nothing had happened.
3. The ability to intercept errors (via ON statements) and to
4. The simple, handy I/O statements GET LIST, PUT LIST, along
with the very handy PUT DATA statement (for debugging mostly).
5. Everything is "ready to go" unlike some other languages, such as Ada!
6. The "whole-array" operations simplify programming and increase under-
standing, and increases execution speed into the bargain;
If A and B are arrays, you can write A = B; to copy an array. You
can use PUT (A); to print an array. [these are trivial examples --
more is available]
7. Dynamic arrays provide the means to write a general program for any
size of array. You aren't bound by some artificial limit. You
automatically obtain exactly the amount of storage you need for an
8. The COMPLEX data type is provided, which simplifies the preparation
of programs because commonsense complex arithmetic is available.
A number of essential functions is at hand for producing: complex
square root, the conjugate, the absolute value, and for extracting
either the real or complex components, and for fabricating a complex
number from two real numbers (SQRT, CONJG, ABS, REAL, IMAG, CPLX). The
** operator is available for raising a complex number to a given power.
A range of (complex) trigonometric functions is provided (includes
SIN, COS, SINH, COSH, etc, and mathematical functions such as LOG).
Even more importantly, debugging is simplified, because
the error messages are specific to complex number operations.
(If you have used complex arithmetic without using the COMPLEX
facilities, the best that the error messages can tell you is in
terms of real (floating-point) operations, which don't necessarily
And the COMPLEX type can be applied to integer as well as to float-
9. PL/I has excellent string-handling facilities. First, there
are two types of string -- the fixed-length string and the
varying-length string. These two data types are supported by a
range of functions that speed up string processing compared to
other languages. It isn't necessary to write your own "string-search"
routines like you need to in other languages such as C and Pascal, for
example. The search functions are already there (INDEX, SEARCH, SEARCHR).
What's more, if the machine has a "search" instruction, it can use that,
and search faster than some hand code using a loop. (Having
to write your own search routine is like having to turn out
your own nuts and bolts on a machine lathe).
PL/I can search from either the right-hand end or from the left-hand
end of a string (SEARCH and SEARCHR)
Joining strings is a simple operation (catenation); the length of
a string can be discovered by using the LENGTH function; strings
containing blanks (or any unwanted character) at the beginning
or the end can be removed using the TRIM function. Strings can
be centered using the CENTER- built-in functions (helps with
page headings etc) and so on.
Other functions include TRANSLATE, for changing ASCII <==> EBCDIC,
and for converting upper to lower case, or for replacing special codes
such as TAB to blank or for any other conversion;
and VERIFY, for performing a search, validating data etc.
10. A macro pre-processor is available on IBM mainframe PL/I (OS) and IBM
OS/2 for the PC, and Liant OPEN PL/I, and probably others.
11. And when you need to do something special (rarely, but it's
nice to know that you have something to fall back on in
an emergency) it's there -- With UNSPEC you can peek at
the bits of a data item (be it a character string, an
integer, bit string, or floating-point data).
For further information about PL/I, systems, and suppliers, see:
IBM's PL/I home page