PL/I is a free-form, easy to learn and easy to use, highly-structured, high-productivity language with a wide variety of features that support scientific, engineering, commercial, and system programming tasks. It is designed to offer robustness, machine independence, structured programming constructs, powerful exception handling capabilities, dynamic storage management, extensive data types, data aggregates (arrays, structures, unions, and combinations thereof), extensive I/O capabilities, and built-in functions for string, mathematical, arithmetic, precision, array, storage control, condition handling, date/time, and other processing.
Unlike many other languages, PL/I is completely free-form and has no reserved keywords. PL/I determines the meaning of keywords from the context of use. The programmer can concentrate on program logic using meaningful names rather than having to worry about the use of words that may have a specific meaning in the language. For example, it is perfectly valid to declare a variable named AREA even though it is also a PL/I keyword. Defaults are provided such that you need not even be aware of other features (e.g. COMPLEX data).
PL/I defines its data types very precisely without regard for any hardware. For example, an "integer" is defined as having a mode of REAL or COMPLEX, base of BINARY or DECIMAL, along with the precision that you require. Therefore, FIXED BINARY(12) declares a binary integer of 12 data bits, whereas FIXED DECIMAL(3) declares a decimal integer of 3 decimal digits. You get precisely what you ask for. The implementers deliver even if the machine has no support for such data type or precision.
PL/I is a block-oriented language, consisting of packages, procedures, begin blocks and statements.
PL/I's block structure allows you to produce highly-modular applications, because blocks can contain declarations that define variable names and storage class. Thus, programmers can restrict the scope of a variable to a single block or a group of blocks, or can cause it to be known throughout the compilation unit or a load module.
Structured programming constructs
PL/I provides many constructs that allow for program logic to be highly modular and well structured for greater reliability and easier development, maintenance, and extensibility. These include:
A characteristic of PL/I that contributes to the range of applications for which it can be used is the variety of data types that can be represented and manipulated. Data types include:
In PL/I, data items can be single data elements or they can be grouped together to form data aggregates that can be referred to either collectively or individually. Data aggregates can be arrays, structures, unions, arrays of structures or unions, structures or unions of arrays, and combinations thereof, providing a very rich foundation for the description and manipulation of any conceivable data.
For example, if an array of structures were used to hold meteorological data for each month of the 20th and the 21st centuries, it might be declared as follows:
Data may be manipulated as individual items or as an aggregate. For example, one invocation of the SQRT built-in function can take the square root of an entire 15-dimensional array, producing an identical array containing square root values in the corresponding elements.
Four different storage classes: AUTOMATIC, STATIC, CONTROLLED, and BASED are provided.. Application objects' data type, representation, nature of use, etc. normally dictates the type of storage class used for each. Programmers can dynamically allocate and free based and controlled storage.
For all storage classes, data may be automatically initialized when it is allocated.
PL/I provides facilities to handle a variety of conditions that can arise during PL/I program execution. These conditions may be expected or unexpected and may be detected by the hardware (e.g ZERODIVIDE) or detected by PL/I (e.g. CONVERSION) or the operating system or other software. Using these facilities, you can indeed write applications in PL/I that can provide non-stop operations. No one comes close!
You can even handle user initiated attention interrupts and normal and abnormal program termination.
Conditions can be enabled in a variety of ways to have your program automatically diagnosed for
PL/I programs have the capability to process various sizes and type of records, access various devices, edit and validate various kinds of input and output data, and easily produce report files. Two types of I/O are provided:
While most mundane operations, such as file opening and closing, are automatically handled by PL/I, many capabilities are provided to allow the PL/I program to have precise control over I/O operations, file opening, closing, and status, and exceptional conditions. I/O condition handling features include:
The macro facility permits conditional compilation and modification of PL/I source before the compilation. For example, a programmer might include specific code during development and testing, and exclude it from a production program.
PL/I was way ahead of its time when it was introduced in 1964. As you can see, it still is! Other languages still cannot grasp some of its concepts.
Copyright (c) by IBM. Reproduced courtesy of IBM.
For a formatted version on the www, visit the original at: What is PL/I? While you're here, why not also take a look at: About PL/I.