Category:PL/I: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
(Added tags=pli)
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{stub}}{{language|PL/I}}
{{stub}}
{{language|PL/I
<lang>
|exec=machine
|strength=strong
|safety=safe
|compat=nominative
|express=explicit
|checking=static
|parampass=both
|tags=pli
|gc=no
|LCT=yes
|tags=pli}}
{{language programming paradigm|Imperative}}

PL/I is a general purpose programming language suitable for commercial, scientific, non-scientific, and system programming.
PL/I is a general purpose programming language suitable for commercial, scientific, non-scientific, and system programming.



It provides the following data types:
It provides the following data types:


Floating-point,
::* &nbsp; Floating-point,
Decimal integer,
::* &nbsp; Decimal integer,
Binary integer,
::* &nbsp; Binary integer,
Fixed-point decimal (with fractional part),
::* &nbsp; Fixed-point decimal &nbsp; (with a fractional part),
Fixed-point binary (that is, with fractional part),
::* &nbsp; Fixed-point binary &nbsp; (that is, with a fractional part),
::* &nbsp; Pointers,
Character strings of two kinds:
::* &nbsp; Character strings of two kinds:
1. fixed-length, and
2. varying-length.
::::# &nbsp; fixed-length, &nbsp; and
::::# &nbsp; varying-length.
Bit strings of two kinds:
::* &nbsp; Bit strings of two kinds:
1. fixed-length, and
::::# &nbsp; fixed-length, &nbsp; and
2. varying length.
::::# &nbsp; varying length.

<br>
The &nbsp; float, &nbsp; integer, &nbsp; and &nbsp; fixed-point &nbsp; types can be &nbsp; real &nbsp; or &nbsp; complex.


The float, integer,and fixed-point types can be real or complex.


Multiple precisions are available for binary fixed-point:
Multiple precisions are available for binary fixed-point:
::* &nbsp; 8 bits,
typically using 8 bits, 16 bits, 32 bits, and 64 bits.
::* &nbsp; 16 bits,
::* &nbsp; 32 bits, &nbsp; and
::* &nbsp; 64 bits.



Multiple precisions are available for floating point:
Multiple precisions are available for floating point:
typically using 32 bits, 64 bits, and 80 bits.
::* &nbsp; 32 bits,
::* &nbsp; 64 bits, &nbsp; and
::* &nbsp; 80 bits.


The language provides for static and dynamic arrays. &nbsp; Of the latter, there are &nbsp; automatic, &nbsp; controlled, &nbsp; and &nbsp; based.
Controlled can be applied to any data type, including scalar, structure, as well as arrays. &nbsp; With controlled, a push-down and pop-up stack is automatically used.


The language provides for static and dynamic arrays.
Of the latter, there are automatic and controlled.
Controlled can be aplied to any data type, including
scalar, structure, as well as arrays.
With controlled, a push-down and pop-up stack is automatically used.


PL/I has four kinds of I/O:
PL/I has four kinds of I/O:
For simple I/O commands, list-directed input and output
::# &nbsp; For simple I/O commands, list-directed input and output requires only the names of the variables. &nbsp; Default format is used, based on the variable's declaration.
requires only the names of the variables.
::# &nbsp; For simple I/O commands, data-directed input and output requires only the names of the variables. &nbsp; For this form, both the names of the variables and their values are transmitted.
::# &nbsp; When precise layouts of input and output data is required, edit-directed I/O is used. &nbsp; A format is specified by the user. &nbsp; The format is flexible, and permits the number of digits, and the number of places after the decimal point to be specified dynamically. &nbsp; The format may also be specified in picture form.
Default format is used, based onthe variable's declaration.
::# &nbsp; For files held on storage media, record-oriented transmission is often used, either for &nbsp; sequential &nbsp; or &nbsp; random access.
For simple I/O commands, data-directed input and output

requires only the names of the variables. For this form,

both the names of the variables and their values are transmitted.
PL/I has built-in checking for such programmer conditions including
When precise layouts of input and output data is required,
::* &nbsp; subscript-range checking,
edit-directed I/O is used. A format is specified by the user.
::* &nbsp; floating-point overflow,
The format is flexible, and permits the number of digits, and
::* &nbsp; fixed-point overflow,
the number of places after the decimal point to be specified
::* &nbsp; division by zero,
dynamically. The format may also be specified in picture form.
::* &nbsp; sub-string range checking, &nbsp; and
for files held on storage media, record-oriented transmission
::* &nbsp; string-size checking.
is often used, either for sequential or random access.

<br>
Any of those may be enabled or disabled by the user.

When any of those conditions occurs, the user/programmer may trap them and recover from them and continue execution.


PL/I has a unique and powerful pre-processor which is a subset of the full PL/I language so it can be used to perform &nbsp; (among other things):
PL/I has built-in checking for such programmer conditions
::* &nbsp; source file inclusion,
including subscript-range checking, floating-point overflow,
::* &nbsp; conditional compilation, &nbsp; and
fixed-point overflow, division by zero, substring range checking,
::* &nbsp; macro expansion.
and stringsize checking. Any of those may be enabled or disabled
by the user.


<br>
When any of those conditions occurs, the user may trap them and
The pre-processor keywords are prefixed with a &nbsp; <big>%</big> &nbsp; (percent symbol).
recover from them and continue execution.
</lang>
<br><br>
==See Also==
* [[wp:PL/I|PL/I on Wikipedia]]
* [[PL/M]]
* [[Polyglot:PL/I and PL/M]]

Latest revision as of 08:48, 29 September 2022

This page is a stub. It needs more information! You can help Rosetta Code by filling it in!
Language
PL/I
This programming language may be used to instruct a computer to perform a task.
Execution method: Compiled (machine code)
Garbage collected: No
Parameter passing methods: By reference, By value
Type safety: Safe
Type strength: Strong
Type compatibility: Nominative
Type expression: Explicit
Type checking: Static
Lang tag(s): pli
See Also:
Listed below are all of the tasks on Rosetta Code which have been solved using PL/I.


PL/I is a general purpose programming language suitable for commercial, scientific, non-scientific, and system programming.


It provides the following data types:

  •   Floating-point,
  •   Decimal integer,
  •   Binary integer,
  •   Fixed-point decimal   (with a fractional part),
  •   Fixed-point binary   (that is, with a fractional part),
  •   Pointers,
  •   Character strings of two kinds:
  1.   fixed-length,   and
  2.   varying-length.
  •   Bit strings of two kinds:
  1.   fixed-length,   and
  2.   varying length.


The   float,   integer,   and   fixed-point   types can be   real   or   complex.


Multiple precisions are available for binary fixed-point:

  •   8 bits,
  •   16 bits,
  •   32 bits,   and
  •   64 bits.


Multiple precisions are available for floating point:

  •   32 bits,
  •   64 bits,   and
  •   80 bits.


The language provides for static and dynamic arrays.   Of the latter, there are   automatic,   controlled,   and   based.

Controlled can be applied to any data type, including scalar, structure, as well as arrays.   With controlled, a push-down and pop-up stack is automatically used.


PL/I has four kinds of I/O:

  1.   For simple I/O commands, list-directed input and output requires only the names of the variables.   Default format is used, based on the variable's declaration.
  2.   For simple I/O commands, data-directed input and output requires only the names of the variables.   For this form, both the names of the variables and their values are transmitted.
  3.   When precise layouts of input and output data is required, edit-directed I/O is used.   A format is specified by the user.   The format is flexible, and permits the number of digits, and the number of places after the decimal point to be specified dynamically.   The format may also be specified in picture form.
  4.   For files held on storage media, record-oriented transmission is often used, either for   sequential   or   random access.


PL/I has built-in checking for such programmer conditions including

  •   subscript-range checking,
  •   floating-point overflow,
  •   fixed-point overflow,
  •   division by zero,
  •   sub-string range checking,   and
  •   string-size checking.


Any of those may be enabled or disabled by the user.

When any of those conditions occurs, the user/programmer may trap them and recover from them and continue execution.

PL/I has a unique and powerful pre-processor which is a subset of the full PL/I language so it can be used to perform   (among other things):

  •   source file inclusion,
  •   conditional compilation,   and
  •   macro expansion.


The pre-processor keywords are prefixed with a   %   (percent symbol).

See Also

Subcategories

This category has the following 3 subcategories, out of 3 total.

Pages in category "PL/I"

The following 200 pages are in this category, out of 446 total.

(previous page) (next page)
(previous page) (next page)