Subject: PL/I Frequently Asked Questions (FAQ)
Date: 12 Apr 1996 18:42:47 +1000
NNTP-Posting-User: rav
Summary: This posting contains a list of Frequently Asked
.Questions (and their answers) about PL/I --
.Programming Language/I.  It should be read by anyone
.wanting to read the newsgroup comp.lang.misc.
.It is of interest to anyone wanting to read any
.of the comp.lang.* newsgroups.
X-Newsreader: NN version 6.5.0 #0 (NOV)

Posting-Frequency: three-monthly (Jan Apr Jul Oct)
Last-Modified: 12 April 1996
Version: 1.3

..FREQUENTLY-ASKED QUESTIONS & ANSWERS
..====================================

(Q1) What is PL/I?

     PL/I is a general-purpose programming language, which
     is used for solving problems in a variety of fields
     such as commerce, science (including mathematics,
     physics, chemistry), engineering (incl. civil, electrical,
     aeronautics), medicine and so on.  It can be used for
     system programming, and the facilitites are such that
     it is rarely if ever necessary to resort to machine-language
     or high-level language programming to solve problems.

     It has more power than Pascal, Fortran 90, BASIC, C, and
     COBOL, and has comparable facilities to Ada.
     The main areas where PL/I is superior include interrupt
     handling, the built-in debugging aids, the macro
     processor facilities, string-handling and input-output
     (see below).

     The language has good documenting and self-documenting
     facilities;  programs are easy to read and to understand.
     It bears some resemblance to Fortran and BASIC.

     The language is suitable for beginners, as well as for
     anyone wanting to become a professional.

     An excellent summary of PL/I can be found at:

     .http://www.torolab.ibm.com/ap/pli/pliwhat.html

     [this is attached at the end of this FAQ.]

     Sample codes can be found at the following URLs:

.http://www.cs.rmit.edu.au/~rav/SEARCH.html
.http://www.cs.rmit.edu.au/~rav/SEARCHR.html
.and
.http://www.cs.rmit.edu.au/~rav/VERIFY.html

.(these are in plain text form).

     Sample codes of a tutorial nature are found at:

.http://www.cs.rmit.edu.au/~rav/INSERT_SORT.html
        http://www.cs.rmit.edu.au/~rav/LISTS.html.

.(Click on the keywords for an explanation.)

(Q2) On what systems is it available?

     PL/I is available on at least the following systems:

     *.IBM PC and compatibles (80x86).

        *  IBM PL/I for OS/2: is available in 3 versions:
..Personal Edition.}
..Professional Edition.} Details at the bottom of this posting
..Toolkit...}.
..---available from IBM

        *  Liant Open PL/I, for 80x86 & Pentium running UNIX SVR3 and SVR4
..---available from Liant Software Corporation
.   .959 Concord Street
.   .Framingham, MA 01701-4613
.   .Tel. (508) 872-8700  Fax (508) 626-2221
..(their PL/I generally is available on Unix-based systems)

     * IBM AS/400
    --- available from IBM

     *.IBM mainframes
..--- available from IBM

     *.HP 9000 HP-UX
..---available from Liant Software Corporation (address sbove)

     *.SPARC SunOS 4.x, Solaris 2.x
..---available from Liant

     *.IBM RS/6000 AIX
..---available from Liant Software Corporation;
..---also available from IBM as PL/I Set for AIX.

     *  Data General AViiON with DG-UX
..---available from Liant.

     *  Digital Equipment Corp. on Open VMS and Alpha AXP systems
..---available from Digital Equipment Corporation.
..UniPrise also has compilers for these systems.

     *  Stratus Computer, Inc.
..---available under VOS on all Stratus computers except AX/R-S.

(Q3) What do the compilers provide?

.All compilers provide enhanced versions of the ANSI standard (the IBM
.AS/400 PL/I compiler adheres to SAA rules).  There's a
.summary of what you'll find in PL/I at
.http://www.torolab.ibm.com/ap/pli/pliwhat.html

        In the case of IBM PL/I for OS/2, PL/I Set for AIX,
        Windws 95 and Windows NT, a number of new language features
        is provided and include:

.(a) list processing in which the pointers (handles) are
.    bound to the structures with which they are linked;
.(b) ordinals;
.(c) user-defined types;
.(d) Unsigned integer type;
.(e) New DO loop options that cause the loop to
.    terminate without overrunning the limit (specifically
.    for ordinals and unsigned integers);
.(f) A much-enhanced macro-processor.
.(this is not an exhaustive list)

.There are also 97 new built-in functions, including
.extra-special DATE/TIME functions, string-handling
.functions, housekeeping functions (e.g.,
.where-am-I-called-from?), and ordinal functions
.(including a function to supply the name of an ordinal!).
.General details are appended to this posting.

        N.B.:  IBM Windows 95 and NT are undergoing beta testing.
               PL/I is already available for Windows NT from
               Liant Software Corporation.

(Q4) What textbooks are available?

.Some of the best include:
.   R.A. Barnes,     "PL/I for Programmers", North-Holland, 1979.
.   J.K. Hughes,     "PL/I Structured Programming", 3rd Ed., Wiley, 1986.
.   G.F. Groner,     "PL/I Programming in Technological Applications",
...     Books on Demand, Ann Arbor, MI, 1971.
.   M.E. Anderson,   "PL/I for Programmers", Prentice-Hall, 1973.
.   D.R. Stoutemyer, "PL/I Programming for Engineering & Science",
...     Prentice-Hall, 1971.
.New books:
.   E. Sturm: "Programmieren in PL/I" (in German language)
...     Vieweg-Verlag (1992), ISBN 3-528-1479-X
.   R. Vowels,.    "Introduction to PL/I, Algorithms, and
...     Structured Programming", Aug. 1995,
...     ISBN 0-9596384-7-4  [details at
...     http://www.cs.rmit.edu.au/~rav/CONTENTS.html]

.The following are good PL/I reference manuals. (They also
.highlight the additions that the OS/2 version provides
.compared with the mainframe version; thus you can use
.it as a reference on either system.)

.   IBM, "PL/I for OS/2: Language Reference", 1994 edition
.   IBM, "PL/I for OS/2: Built-in Functions", 1994 edition

(Q5) Is there a newsletter?

."The PL/I Connection" is published by Team PL/I.
.To request a free subscription, send email to:
.teampli@vnet.ibm.com

.Recent copies are accessible at:
.http://www.torolab.ibm.com/ap/pli/plinews.html

(Q6) Is there a home page?

.There are at least five of interest:
.   http://www.torolab.ibm.com/ap/pli/plihome.html
.   http://www.liant.com
..(then click on the LPI button)
.   http://www.dec.com/home.html
..(then select OpenVMS ..., or you may find the direct
.. link quicker ->
.   http://www.uniprise.com/
.   ftp://ftp.digital.com/pub/Digital/info/SPD/25-30-21.txt
.   http://www.yahoo.com/Computers_and_Internet/Languages/
..Or if you prefer, you can start on http://www.yahoo.com/ and take
..it from there.  When the Languages display comes up, 
..look for PL/I.  Click on that, and then you can
..go to different sites.

.If you know of any other home pages, please advise the author.

(Q7) Where can I find discussion groups?

     *.Join PL1-L@PACEVM on the internet.
.   To subscribe, send a note to LISTSERV@PACEVM.DAC.PACE.EDU
.   In the body of the note, enter:

.   SUB PL1-L yourname

.   To post a comment, send it to PL1-L@PACEVM
.   (or to... PL1-L@PACEVM.DAC.PACE.EDU )

     *.On Compuserve, enter: go os2df1
.   Then go to subsection 6: "Rexx and other languages".

     *  A new newsgroup was established in January 1996
.following the passing on 3 Jan. 1996 of voting for
        the newsgroup "comp.lang.pl1" (350 votes for, 18
        votes against).

================================================================

Details about IBM PL/I for OS/2:
-------------------------------

Date:         Wed, 10 Aug 1994 22:01:00 PDT
From: Paige Vinall 8-543-2106 <vinall@VNET.IBM.COM>
Subject:      Re: Summary of IBM announcement 294-408
X-To:         "(language) PL1 discussions"
              <PL1-L%UIUCVMD.bitnet@vm42.cso.uiuc.edu>

Introducing Three New Products for Today's Programmer
-----------------------------------------------------
PL/I is well known as a powerful, proven language that was designed
with the programmer in mind.

Today's programmer is developing complex client/server applications.
Today's programmer is expected to be more productive; to write more
code in less time and to write better quality applications in the
most cost effective environment.

IBM introduces three new members of the PL/I Family that have been
designed with today's programmer in mind:  PL/I for OS/2 Professional
Edition, PL/I for OS/2 Personal Edition and the PL/I for OS/2 Toolkit.

Get Client-Server Right with PL/I
---------------------------------
If your company has a large inventory of PL/I applications, you are
probably looking for a way to take advantage of new technologies while
leveraging the investments you have already made.  Are you wondering
if there's a way to reduce your mainframe overhead and program more
productively, without compromising the power and flexibility that made
PL/I an excellent investment over the years?

PL/I for OS/2 Professional Edition and the PL/I for OS/2 Toolkit can
relieve your mainframe by letting you move your applications to a
powerful development environment on the PC.  The PL/I for OS/2
products provide a visual PM front-end for developing VSAM, DB2,
CICS, and IMS Client Server/2 applications.

Continue to use your PL/I expertise while optimizing for the creation
of database and transaction-driven applications that will execute on a
mainframe, as client/server applications, or on a stand-alone PC.


Benefit from the Ease of Use and Performance of OS/2
----------------------------------------------------
OS/2 has many powerful features that makes it an attractive environment
for PL/I development.  Here are just a few:

     - Ease of use through an object-oriented iconic "drag and drop"
       interface which makes OS/2 easy to learn and use
     - Performance that is predictable and consistent
     - True multithreading that lets you use multiple programs
       simultaneously
     - 32-bit addressability means you can tap the potential of today's
       advanced microprocessing technology

With these features, OS/2 can raise your computing capability to a whole
new level by allowing you to work quickly, easily, and intuitively.

PL/I takes advantage of these innovative features in OS/2.  The PL/I
for OS/2 products include header files that let you develop OS/2
Presentation Manager applications; a visual tool that generates PL/I
code as you 'paint' Presentation Manager applications, and PL/I supports
OS/2's multi-threading capability to further improve performance.

Together, PL/I and OS/2 provide you with a powerful, reliable
application development solution that increases your choices and
multiplies your opportunity to get bigger and better benefits from
your PL/I code and from your system.

Access DB2 with PL/I for OS/2
-----------------------------
If you depend on data stored in a DB2 database across multiple platforms,
you probably want to access it from your PL/I applications, whether they
are running on MVS or OS/2.

PL/I for OS/2 Professional Edition includes a preprocessor that supports
DB2/2 and lets you embed SQL statements in your PL/I programs.  If you
have a distributed database connected by DDCS/2, you can access data
stored in other DB2 products, from PL/I applications on OS/2.

You can now access DB2 data on multiple platforms from PL/I products on
multiple platforms.  PL/I's database solution lets you build new
client/server applications or extend the life of your existing mainframe
PL/I applications.


Develop CICS Applications in a Client/Server Environment
--------------------------------------------------------
CICS is the transaction management solution of choice for many
businesses.  If your company uses CICS for online transaction
processing, you can take advantage of the client/server support
provided by both CICS OS/2 and PL/I for OS/2 Professional Edition.

PL/I for OS/2 Professional Edition includes a CICS preprocessor that
lets you develop CICS applications on OS/2.  CICS OS/2 and PL/I
for OS/2 Professional Edition provide powerful facilities
for improving your productivity in the development and debugging
of new applications.  PL/I for OS/2 is a valuable tool for
development of CICS applications for running on CICS/VSE and
CICS/ESA systems.

The transaction management solution provided by CICS OS/2 and PL/I for
OS/2 Professional Edition lets you build new client/server applications
or extend the life of existing mainframe applications.


Use PL/I to Develop IMS Client Server/2 Applications
----------------------------------------------------
If you have IMS data or transactions on a mainframe, you can now
access them from applications written in a more productive
environment.

Using PL/I for OS/2 Professional Edition and IMS Client Server/2, you
can develop client/server applications that call IMS data or invoke
IMS transactions that are running on a mainframe.  By combining these
two products, you can access your mainframe IMS data and transactions
from a more flexible environment, while preserving data integrity.

Developing and maintaining applications that access mainframe IMS
can be very easy with PL/I.  You can develop graphics-based
applications with PL/I for OS/2 Professional Edition.  This simplifies
the process by letting programmers paint an application, therefore
automating the application development process.  Did you have any
idea IMS applications could be this easy to write?


Tailor PL/I for Your Organization
---------------------------------
PL/I is a powerful language that affords programmers a lot of
flexibility.  You can, for example, alter the severity of compiler
messages or suppress them completely.  When debugging your
program, you can get a listing of diagnostic messages that identify
errors in the source program. Your program listing can also
include an attribute and cross reference table which tells you not
only in which lines a variable is referenced, but also in which
lines it is altered.


Improve Your Productivity with PL/I for OS/2 and WorkFrame/2
------------------------------------------------------------
PL/I for OS/2 provides a cost effective visual desktop development and
test environment.  PL/I for OS/2 with WorkFrame/2, a GUI project
manager, makes application development simpler and more straight-
forward.  Using PL/I for OS/2 and Workframe/2 you can, for example,
set compiler and other options and link them to a specific program or
project for repeated use.  Using WorkFrame/2, you can also identify
and locate error messages and edit your source code without ever
leaving your work session.


Clean Up Your PL/I Applications with a Graphical Facility
---------------------------------------------------------
With PL/I for OS/2's powerful GUI debug facility, you can set change,
entry, or statement breakpoints.  Other debugging features
include the ability to trap conditions and monitor changes
in variables during execution of your program.


Benefit from New PL/I Language Features
---------------------------------------
The following is a list of some new language enhancements in the
PL/I for OS/2 products:
-- Strongly typed enumerations, typed structures and unions,
   and user-defined types make it easier for you to identify
   potential problems at compile time.

-- PL/I's various storage classes--including automatic,
   static, controlled, defined, and based--increase the
   flexibility of the language.

-- A choice of linkages and parameter-passing mechanisms
   lets you call C, C++, REXX, and Fortran applications from
   within your PL/I applications.

-- The new PACKAGE statement allows you to group
   related declarations and procedures that share name
   scope.

-- A state-of-the-art macro facility is now available in
   PL/I for OS/2.

-- With restricted expressions and named constants, you can
   create parameters in your source code so that when
   one item changes, all related items automatically
   adjust.


Mainframe Compatibility
-----------------------
PL/I for OS/2 Professional Edition supports
EBCDIC character data and hexadecimal float data.  It
also provides SAA language level checking and other
features that improve compatibility with mainframe PL/I.


Choose the PL/I That's Right for You
------------------------------------
PL/I for OS/2 comes in two varieties...a Personal
Edition and a Professional Edition.  Both editions
include a full 32-bit compiler, run-time and graphical
debugging facility.

PL/I for OS/2 Personal Edition was designed for small
software development companies, consultants and students.
The Personal Edition supports new PL/I application
development on stand-alone PCs or small LANs.

PL/I for OS/2 Professional Edition includes all the
features of the Personal Edition, additional function that
enhances its compatibility with the mainframe compiler,
preprocessor support for DB2/2 and CICS OS/2, and support
for IMS CS/2.  PL/I for OS/2 Professional Edition was
designed for programmers who develop or maintain mainframe
PL/I applications and are looking for a reliable client/server
solution.

The PL/I for OS/2 Toolkit consists of additional tools,
including a graphical prototyping tool and a code generator
that can help you develop graphical user interfaces.  The
PL/I for OS/2 Toolkit can help you streamline the programming
process, to offer a complete development environment for PL/I
for OS/2 PM applications.  It can be used as both a prototyping
tool and a code generator to develop user interfaces.


Installation Information
------------------------
PL/I for OS/2 is available on 3/5" diskettes and includes an
automated installation program.  Generated object programs
run under IBM OS/2 Version 2.0 (or later).

IBM WorkFrame/2 Version 2.1 is included with the PL/I for OS/2
package and requires OS/2 Version 2.1 if you choose to install
it.

Order PL/I for OS/2 Today
-------------------------
To order PL/I for OS/2, contact an IBM representative.  Or, from
the following countries, please call the corresponding number:

Austria           0222 21145 2500
France            05 03 03 03
Italy             167 018001
Netherlands       030 384040
Switzerland       01 436 62 33
United Kingdom    0705 564414
United States     1-800-IBM-CALL

Please ask for part number 10H7848 (Professional Edition) or
10H7819 (Personal Edition).
The Toolkit (part number 1322966) is a feature of either the
PL/I for OS/2 Personal Edition or PL/I for OS/2 Professional
Edition.
From anywhere, at anytime, you can send your questions to the
PL/I development team.  Our fax number is 1 408-463-4820.

**************************
Features of PL/I for OS/2 Personal Edition
==========================================
List Price: [New price $229 as at 20/7/95][Was $299 (US)] including IBM Service

-- Implementation of the PL/I
   language
-- WorkFrame/2 support
-- PL/I Interactive Test Facility
   (PLTEST)
-- Interlanguage communication
-- Macro facility
-- PM Programming

Features of PL/I for OS/2 Professional Edition
==============================================
List Price: [New price $949 as at 20/7/95] [was $1250 (US)] including IBM Service

-- All features of PL/I for OS/2
   Personal Edition
-- Support for EBCDIC character
   and hexadecimal float data
-- SAA language level checking
-- Support for DB2/2, including
   an SQL preprocessor
-- Support for CICS OS/2, including
   a CICS preprocessor
-- Support for IMS Client Server/2

Features of PL/I for OS/2 Toolkit
=================================
List Price: $155 (US) including IBM Service [New price as at 20/7/95]

-- Visual PL/I, a tool to build PM applications
-- A programming aid designed to help you convert C header
   files to PL/I header files
-- OS/2 Developers Toolkit 2.1

*****************************************************************
CICS, CICS OS/2, DB2, DB2/2, IBM, IMS Client Server/2, IMS CS/2,
OS/2, Presentation Manager, and SAA are trademarks of the
International Business Machines Corporation.
*****************************************************************


Paige Vinall

Path: goanna.cs.rmit.oz.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!swiss.ans.net!solaris.cc.vt.edu!uunet!juniper.almaden.ibm.com!VNET.IBM.COM
From: vinall@VNET.IBM.COM (Paige Vinall)
Message-ID: <19940914.091127.617@almaden.ibm.com>
Date: Wed, 14 Sep 94 07:32:09 PDT
Newsgroups: comp.lang.c
Subject: Re: PL/I's leave (Was: Re: Goto Pro's and Con's)
Organization: PL/I Development, IBM
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: UReply 3.1
References: <1885728766.90677864@otsrvr.ortel.org>
Lines: 32

In <1885728766.90677864@otsrvr.ortel.org> Paul Long writes:
>Well, you certainly speak from a position of authority, but I could swear
>that, about 15 years ago, leave was extended to accept the number of levels
>to leave.  I think I even remember using it.  Could there have been two
>extensions: first to the number of levels, then to a label?
>
I don't think so.  At least not IBM's implementations.  It could be
that another company allows a numeric expression on a leave statement.
It would make maintenance a pain when a new loop was inserted.
Maybe BASIC allows this?

>BTW, at one time I really liked PL/I.  I used it in college quite a bit and
>did my first consulting work with it.  Are you just maintaining it for legacy
>systems, or is there still life left in the old bird?  And when is
>Object-PL/I comng out.  :-)
>
We promoting it for both legacy systems and new work.  IBM is using it
for our own development.  We delivered PL/I for OS/2 and are now
working on PL/I for AIX/UNIX.  We are also looking at OO PL/I but
I don't think that is as important as getting on other platforms.

If you have ideas or suggestions, you might want to subscribe to
the PL/I bitnet mailing list.  It is PL1-L@uiucvmd.bitnet.  To
subscribe, send a note to listserv@uiucvmd.bitnet.  In the
body of the note, enter:

  SUB PL1-L yourname

To post a comment, send it to PL1-L@uiucvmd.bitnet.

Paige Vinall - PL/I Development Manager, IBM
Internet: vinall@vnet.ibm.com,  Phone: (408) 463-2106
____________________________________________________________
Path: goanna.cs.rmit.edu.au!aggedor.rmit.EDU.AU!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!psgrain!fizban.solace.mh.se!vampire.xinit.se!newsfeed.tip.net!news.decus.se!decus.se!banckpm
From: banckpm@decus.se (Per Magnus Banck, Electoral Information Service, Sweden)
Newsgroups: comp.lang.misc
Subject: Re: PL/I Compiler Vendors wanted
Date: 21 Jul 95 12:24:22 MET
Organization: Decus Sverige (Sweden)
Lines: 54
Distribution: world
Message-ID: <1995Jul21.122422@decus.se>
NNTP-Posting-Host: ns.decus.se

Charles Stump (cstump@levtech.com, 3ugqro$5nb@news1.digex.net) wrote:
> I am looking for contact information for PL/I compiler vendors. Anyone 
> have any names and/or phone numbers?

As I do not know what Your specific need is, here are a quick list:

*  IBM   (e-mail: teampli @ vnet.ibm.com )

   It looks as they made big efforts in the new version for OS/2.
   I can't say more for the moment, have not OS2 loaded yet.

   Standalone version for some $ 200 [dont know exact amount].
   Fullblown version with DB2 and CICS, mainframe access and the lot
   for around $1000+.   

*** Digital ( http://www.dec.com/home.html )

   Their PL/1 compiler on OpenVMS for VAX is very good. I have used
   since around 1982 in writing many system programming tools.
   And it generally saved me all the trouble of assembly language.

   It is also available for RISC Ultrix (and OpenVMS for Alpha I belive).

   IMHO, they make much to little advertisment about this jewel.

*** Liant  ( email: dickp @ lpi.liant.com )

   Versions for various versions of UNIX. Mature (version 5).
   Also claims to have versions for NT and MSDOS (anyone tried?).

   Seems somewhat expensive to starters but very able tool for
   doing migration with.

*** Others

   Data General had a compiler back in the early 80'ies. Lost track.
   Data Research hade a compiler for CP/M.
   Rumours is that Prime also had a compiler for Prime/OS.

There is a mailing list for PL/1 at LISTSERV @ vmd.cso.uiuc.edu

IBM have also lauched a newsletter called the PL/I Connection.
You call use the address above.

Please, keep in touch.

=========================================================================
  Per Magnus Banck                  Email:  banckpm@decus.se
  Electoral Information Service     Phone:  +46 8 274543
  Box 3082, S-17103 Solna, Sweden   Fax:    +46 8 6861700 (attn: Banck)
=========================================================================


..PPPPPPPPP    L                   /   I
..P        P   L                  /    I
..P        P   L                 /     I
..P       P    L                /      I
..PPPPPPPP     L               /       I
..P            L              /        I
..P            L             /         I
..P            L            /          I
..P            LLLLLLLLLL  /           I

...What is PL/I?

---------------------------------------------------------------------------

For those of you who know little or nothing about PL/I, let's briefly
review why PL/I is indeed the language of choice.

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.

Free-form easy-to-learn

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).

Machine independent

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.

Program structure

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:

   * PACKAGEs, PROCEDUREs, and BEGIN blocks permit a high degree of data
     and program logic encapsulation.
   * SELECT ... WHEN ... OTHERWISE permit sophisticated case logic.
   * DO statement permits grouping of a number of statements as a single
     unit that can be executed unconditionally one time, forever, or while
     a condition is true or until a condition becomes true.

Combinations of these along with loop controlling statements, LEAVE and
ITERATE, allow complex looping logic to be expressed in simple
comprehensible terms.

Data types

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:

   * Real or complex, floating-point or fixed-point, signed or unsigned
     binary or decimal, and numeric and editable picture data with
     programmer selected precision.
   * Varying or nonvarying, character or bit or graphic, run-time
     adjustable or compile-time fixed length strings.
   * Program control data supporting pointer and offset locators,
     adjustable or fixed size areas for grouping of dynamic allocations,
     entry data ("function pointers"), and file, label, and format data.
   * Areas may be written out to the disk and read back at a later date
     permitting preservation of linked-lists.

Data arrays, structures, and unions

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:

    Declare 1 Year(1901:2100),
              3 Month(12),
                5 Temperature,
                  7 High decimal fixed(4,1),
                  7 Low decimal fixed(4,1),
                5 Wind&us.velocity,
                  7 High decimal fixed(3),
                  7 Low decimal fixed(3),
                5 Precipitation,
                  7 Total decimal fixed(3,1),
                  7 Average decimal fixed(3,1),
              3 * char(0);

The weather data for July 1991 is contained in the element Year(1991,7) of
the array of structures Year. Portions of this data can be referred to by
Temperature(1991,7) or Precipitation(1991,7).

Data manipulation

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.

Built-in functions

PL/I provides almost 200 built-in functions, pseudovariables, and
subroutines that manipulate scalar and aggregate data. These functions
cover:

   * Character, Bit, and Graphic string manipulation (e.g. INDEX, CENTER)
   * Arithmetic computation (e.g. MAX, RANDOM)
   * Mathematical computation (e.g. ATANH, GAMMA)
   * Floating point inquiries (e.g. HUGE, TINY)
   * Floating point manipulation (e.g. SUCC, SCALE)
   * Integer manipulation (e.g. IAND, RAISE2)
   * Precision handling (e.g. BINARY, UNSIGNED)
   * Array manipulation (e.g. HBOUND, SUM)
   * Storage control (e.g. EMPTY, ADDR)
   * Condition handling (e.g. ONCHAR, ONLOC)
   * Input/Output (e.g. COUNT, FILEOPEN)
   * Date/Time manipulation (e.g. DATETIME, DATE)

Storage classes, control, and dynamic storage allocation

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.

Condition handling

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.

Program checkout

Conditions can be enabled in a variety of ways to have your program
automatically diagnosed for

   * Array subscripts being out of range
   * String and substrings being out of range
   * Data exceeding declared or machine supported precisions

Input and Output

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:

   * Record-oriented input/output deals with aggregates of data, called
     records, and logically transmits one record at a time without
     performing any data conversions. Such files may be indexed, relative,
     or consecutive.
   * STREAM I/O deals with a logically continuous stream of characters
     (that may physically reside externally as records) and logically
     transmits a data item at a time performing conversions between the
     internal form and the external form. The data items may transmitted as
     a list, edited list, an annotated list, or a combination of these.

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:

   * End of file reached (ENDFILE)
   * End of a report page reached (ENDPAGE)
   * Record not found (KEY)
   * Record truncated (RECORD)
   * I/O errors (TRANSMIT)
   * File cannot be found (UNDEFINEDFILE)
   * Whether a file is open (FILEOPEN)
   * Key for which record was not found (ONKEY)
   * Source that caused conversion error (ONSOURCE)
   * The Character within source that caused conversion error (ONCHAR)
   * File associated with the I/O condition (ONFILE)
   * Page number of current report page (PAGENO)
   * Line number of current line within the current report page (LINENO)

Macro Facility

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:

http://www.torolab.ibm.com/ap/pli/pliwhat.html
