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 not 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 (as happens in the language C, for instance); 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
floating-point outputs.
If you are using the European convention for numbers, that's easily done
with PICTURE formats (e.g., to produce 123.456.789,00).
And if you don't want to be bothered with formats, you can use
simple free-formatted output, e.g. PUT (X);
The best part 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 unidentified location somewhere in
the program. (When you've had this message in a 20,000 line program,
you'll know what I mean!)
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.
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
make sense).
And the COMPLEX type can be applied to integer as well as to float-
ing-point data.
PL/I can search from either the right-hand end or from the left-hand
end of a string (e.g., SEARCH and SEARCHR).
Many string operations are achieved simply in PL/I:
Other functions include TRANSLATE, for changing ASCII <--> EBCDIC,
and for converting upper to lower case, or for replacing special codes
such as TAB with a blank, or for any other conversion;
and VERIFY, for performing a search, validating data etc.
Need to know what's in
PL/I ?
There are also informative newsletters
The PL/I Newsletter and
The PL/I Connection to keep you up-to-date.
Like some information about
IBM's PL/I products including PL/I for OS/2?
Or would you just like specific details about the enhanced
PL/I for OS/2?
Or
PL/I Set for AIX? (the compiler is also available on Windows 98
and Windows NT).
Also try
Liant's PL/I
which you can use on a variety of Unix systems and Windows systems
including
Windows XP, 2000, Me/98 (Intel),
Redhat Linux (Intel),
HP 9000 HP-UX,
SPARC Solaris 2.x,
Solaris ix (Intel), and
IBM RS/6000 AIX.
Contact Liant for other systems.
Digital Equipment Corporation's PL/I .
Available for Compaq systems is
Kednos PL/I for Digital
Unix
which is available on a range of Compaq's systems.
Kednos PL/I for Compaq Alpha (including a free hobbyist's licence)
can be found by browsing at
Kednos.
Look at some
Frequently-asked Questions and their Answers.
You might also like to browse
PL/I.
Other PL/I resources include:
A comparison of PL/I and C?
and
Reverse Engineering Tool for PL/I, which is is undergoing beta testing.
For further information, email info@levtech.com
PL/I source code, to implement the new built-in functions
(on non-VisualAge PL/I systems)
SEARCH
SEARCHR
and
VERIFY (3-argument version)
and VERIFYR)
(these are in plain text form).
Further PL/I examples of a tutorial nature are an
Shell Sort
and a
linked list creation
procedure (under construction).
Here you'll find
a catalog of PL/I resources including source codes.
In particular, you'll find source codes for
Year 2000 dates.
Updated 14 May 2003.
Why you should consider using PL/I:
And PL/I is at home in any business application.
Outstanding and helpful PL/I facilities include:
Thus, in some situations, old programs (manipulating dates having
2-digit years) can handle dates from the year 2000 and beyond.
And all that is needed are trivial alterations to declarations!
That translates to a huge saving in Y2K conversion costs.
In VisualAge and Enterprise PL/I, the DATETIME built-in function can
produce the
date in any one of 37 different formats (e.g., year first, day first,
month as Feb or FEB, for example). The other functions (which also
support the Y2K facilities) are:
DAYS, DAYSTODATE, DAYSTOSECS, SECS, SECSTODATE, SECSTODAYS, VALIDDATE
and WEEKDAY. With these functions, it is easy to perform day
computations -- even those that extend into the year 2000 -- for example,
to calculate the day name of a day that is, say, 40 days hence.
These functions include REPATTERN, Y4DATE, Y4JULIAN, and Y4YEAR,
the latter three converting 2-digit years to 4-digit years.
For further information about PL/I, systems, and suppliers, please read
on . . .
If this site is down, visit them at
Levtech.
These are just a few samples. There are more in the
PL/I Resources page.
This document is available from: http://www.users.bigpond.com/robin_v/pli.htm