PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has been in continuous use by academic, commercial and industrial organizations since it was introduced in the 1960s.
A PL/I American National Standards Institute (ANSI) technical standard, X3.53-1976, was published in 1976.
PL/I's main domains are data processing, numerical computation, scientific computing, and system programming. It supports recursion, structured programming, linked data structure handling, fixed-point, floating-point, complex, character string handling, and bit string handling. The language syntax is English-like and suited for describing complex data formats with a wide set of functions available to verify and manipulate them.
Early history In the 1950s and early 1960s, business and scientific users programmed using different programming languages, usually on different computer hardware. Business users were moving from Autocoders via COMTRAN to COBOL, while scientific users programmed in Fortran, ALGOL, GEORGE, and others. The IBM System/360 (announced in 1964 and delivered in 1966) was designed as a common machine architecture for both groups of users, superseding all existing IBM architectures. Similarly, IBM wanted a single programming language for all users. It hoped that Fortran could be extended to include the features needed by commercial programmers. In October 1963 a committee was formedThe committee actually had 8 members at the time the report was released. They were:
Hans Berg, Lockheed Burbank George Radin, IBM James Cox, Union Carbide Bruce Rosenblatt, Standard Oil of California, Chair. Douglas McIlroy, Bell Laboratories Robert Sheppard, Procter & Gamble. From the GUIDE organization C.W. Medlock, IBM Bernice Weitzenhoffer, IBM. composed originally of three IBMers from New York and three members of SHARE, the IBM scientific users group, to propose these extensions to Fortran. Given the constraints of Fortran, they were unable to do this and embarked on the design of a new programming language based loosely on ALGOL labeled NPL. This acronym conflicted with that of the UK's National Physical Laboratory and was replaced briefly by MPPL (MultiPurpose Programming Language) and, in 1965, with PL/I (with a Roman numeral "I"). The first definition appeared in April 1964.Report II of the SHARE Advanced Language Development Committee, June 25, 1964
IBM took NPL as a starting point and completed the design to a level that the first compiler could be written: the NPL definition was incomplete in scope and in detail. Control of the PL/I languageControl of the language was vested in a dedicated Language Control group and a Language Control Board that included representatives of the compiler groups (6 by 1973) in three countries. Daily communication was by telex. Changes and extensions were made through a Language Log that reached several thousand detailed points. A management level Language Review Board resolved issues escalated to it by the Control Board. was vested initially in the New York Programming Center and later at the IBM UK Laboratory at Hursley. The SHARE and GUIDE user groups were involved in extending the language and had a role in IBM's process for controlling the language through their PL/I Projects. The experience of defining such a large language showed the need for a formal definition of PL/I. A project was set up in 1967 in IBM Laboratory Vienna to make an unambiguous and complete specification.The Universal Language Document (ULD). Technical reports TR25.081, TR25.082, TR25.083, TR25.0S4, TR25.085, TR25.086 and TR25.087, IBM Corp Vienna Austria June 1968 This led in turn to one of the first large scale Formal Methods for development, VDM.
Fred Brooks is credited with ensuring PL/I had the CHARACTER data type. Christopher J. Date and a colleague added relational database extensions based on Edgar Codd's work.
The language was first specified in detail in the manual "PL/I Language Specifications. C28-6571", written in New York in 1965, and superseded by "PL/I Language Specifications. GY33-6003", written by Hursley in 1967. IBM continued to develop PL/I in the late sixties and early seventies, publishing it in the GY33-6003 manual. These manuals were used by the Multics group and other early implementers.
The first compiler was delivered in 1966. The Standard for PL/I was approved in 1976.
Goals and principles The goals for PL/I evolved during the early development of the language. Competitiveness with COBOL's record handling and report writing was required. The language's scope of usefulness grew to include system programming and event-driven programming. Additional goals for PL/I were:
Performance of compiled code competitive with that of Fortran (but this was not achieved) Extensibility for new hardware and new application areas Improved productivity of the programming process, transferring effort from the programmer to the compiler Machine independence to operate effectively on the main computer hardware and operating systems
To achieve these goals, PL/I borrowed ideas from contemporary languages while adding substantial new capabilities and casting it with a distinctive concise and readable syntax. Many principles and capabilities combined to give the language its character and were important in meeting the language's goals:
Block structure, with underlying semantics (including recursion), similar to Algol 60. Arguments are passed using call by reference, using dummy variables for values where needed (call by value). A wide range of computational data types, program control data types, and forms of data structure (strong typing). Dynamic extents for arrays and strings with inheritance of extents by procedure parameters. Concise syntax for expressions, declarations, and statements with permitted abbreviations. Suitable for a character set of 60 glyphs and sub-settable to 48. An extensive structure of defaults in statements, options, and declarations to hide some complexities and facilitate extending the language while minimizing keystrokes. Powerful iterative processing with good support for structured programming. There were to be no reserved words (although the function names DATE and TIME initially made it impossible to meet this goal). New attributes, statements and statement options could be added to PL/I without invalidating existing programs. Not even IF, THEN, ELSE or DO were reserved.Some compilers chose to reserve these identifiers, or issue warnings if they found them used as identifiers. But the subsequent introduction of a case statement shows the value of the principle. Orthogonality: each capability to be independent of other capabilities and freely combined with other capabilities wherever meaningful. Each capability to be available in all contexts where meaningful, to exploit it as widely as possible and to avoid "arbitrary restrictions". Orthogonality helps make the language "large". Exception handling capabilities for controlling and intercepting exceptional conditions at run time. Programs divided into separately compilable sections, with extensive compile-time facilities (a.k.a. macros), not part of the standard, for tailoring and combining sections of source code into complete programs. External names to bind separately compiled procedures into a single program. Debugging facilities integrated into the language.
Language summary The language is designed to provide sufficient facilities to be able to satisfy the needs of all programmers, regardless of what problems the language is being applied to. The summary is extracted from the ANSI PL/I StandardANS Programming Language PL/I. X3.53-1976 and the ANSI PL/I General-Purpose Subset Standard.
A PL/I program consists of a set of procedures, each of which is written as a sequence of statements. The %INCLUDE construct is used to include text from other sources during program translation. All of the statement types are summarized here in groupings which give an overview of the language (the Standard uses this organization). Category Statement Structural PROCEDURE (or PROC) ENTRY BEGIN DO END Declarative DECLARE (or DCL) DEFAULT (or DFT) FORMAT Flow of control CALL IF SELECTGO TO RETURN STOP Null statement Category Statement Interrupt handling ON SIGNAL REVERT Storage ALLOCATE (or ALLOC) FREE Assignment statement Input/Output OPEN CLOSE Stream input/output GET PUT Record input/output READ WRITE REWRITE LOCATE DELETE (Features such as multi-tasking and the PL/I preprocessor are not in the Standard but are supported in the PL/I F compiler and some other implementations are discussed in the Language evolution section.)
Names may be declared to represent data of the following types, either as single values, or as aggregates in the form of arrays, with a lower-bound and upper-bound per dimension, or structures (comprising nested structure, array and scalar variables): Arithmetic (expanded below) CHARACTER PICTURE for Arithmetic data PICTURE for Character data AREA BIT ENTRY FILE FORMAT LABEL OFFSET POINTER
The arithmetic type comprises these attributes: a base (BINARY or DECIMAL), and a scale (FIXED or FLOAT), and a mode (REAL or COMPLEX), and a PRECISION (number of digits, and for fixed point numbers, a scale factor) The base, scale, precision and scale factor of the Picture-for-arithmetic type is encoded within the picture-specification. The mode is specified separately, with the picture specification applied to both the real and the imaginary parts.
Values are computed by expressions written using a specific set of operations and builtin functions, most of which may be applied to aggregates as well as to single values, together with user-defined procedures which, likewise, may operate on and return aggregate as well as single values. The assignment statement assigns values to one or more variables.
There are no reserved words in PL/I. A statement is terminated by a semi-colon. The maximum length of a statement is implementation defined. A comment may appear anywhere in a program where a space is permitted and is preceded by the characters forward slash, asterisk and is terminated by the characters asterisk, forward slash (i.e. ). Statements may have a label-prefix introducing an entry name (ENTRY and PROCEDURE statements) or label name, and a condition prefix enabling or disabling a computational condition e.g., (NOSIZE)). Entry and label names may be single identifiers or identifiers followed by a subscript list of constants (as in L(12,2):A=0;).
A sequence of statements becomes a group when preceded by a DO statement and followed by an END statement. Groups may include nested groups and begin blocks. The IF statement specifies a group or a single statement as the THEN part and the ELSE part (see the sample program). The group is the unit of iteration. The begin block (BEGIN; stmt-list END;) may contain declarations for names and internal procedures local to the block. A procedure starts with a PROCEDURE statement and is terminated syntactically by an END statement. The body of a procedure is a sequence of blocks, groups, and statements and contains declarations for names and procedures local to the procedure or EXTERNAL to the procedure.
An ON-unit is a single statement or block of statements written to be executed when one or more of these conditions occur:
a computational condition, CONVERSION (CONV) FIXEDOVERFLOW (FOFL) OVERFLOW (OFL) SIZE STRINGRANGE (STRG) STRINGSIZE (STRZ) SUBSCRIPTRANGE (SUBRG) UNDERFLOW (UFL) ZERODIVIDE (ZDIV) or an Input/Output condition, ENDFILE(file) ENDPAGE(file) KEY(file) NAME(file) RECORD(file) TRANSMIT(file) UNDEFINEDFILE(file) (UNDF) or one of the conditions: AREA, CONDITION (identifier), ERROR, FINISH