Follow

Supported PL/I Statements

Table of Contents

  1. Overview
  2. Declarations & storage
  3. Procedures, entries & control transfer
  4. Control flow
  5. Condition handling
  6. File & stream I/O
  7. Assignment
  8. Program flow & termination
  9. Embedded sublanguages
  10. Diagnostics & comments
  11. Preprocessor
  12. Summary
  13. Related articles

Audience: developers and technical decision-makers checking which PL/I statements and language constructs the Heirloom PL/I compiler translates. A reference companion to the runtime's "Supported …" feature lists.


Overview

This is a grouped reference to the PL/I statements and language constructs the compiler translates to Java, with a one-line note on each. It covers the core procedural language; embedded EXEC SQL and EXEC CICS have their own dedicated references (see Supported SQL Features and Supported CICS Features), and data types have their own list (see Supported PL/I Data Types).

Note: This is a summary of commonly used statements, not an exhaustive, clause-by-clause specification. If you need confirmation that a specific statement, option, or clause your application relies on is covered, contact Heirloom support with the detail.


Declarations & storage

Statement Notes
DECLARE / DCL Declare variables, structures, and types with attributes (FIXED, BINARY, CHARACTER, PICTURE, POINTER, FILE, ENTRY, …), including LIKE, INITIAL, BASED, DEFINED
ALLOCATE Allocate storage for CONTROLLED or BASED variables, with optional SET of a pointer
FREE Release CONTROLLED / BASED storage previously allocated
PACKAGE Group related declarations and procedures into a package scope, with exports

Procedures, entries & control transfer

Statement Notes
PROCEDURE / PROC Define a procedure with parameters, RETURNS, and OPTIONS (MAIN, REENTRANT, COBOL, …)
ENTRY Define an alternate entry point, with its own parameters and return type
BEGIN … END Block scope for grouping statements with local visibility
CALL Invoke a procedure or subroutine, with an optional argument list
RETURN Return from a procedure, with an optional return value

Control flow

Statement Notes
IF … THEN … ELSE Conditional execution, including nested THEN DO … END blocks
SELECT … WHEN … OTHERWISE … END Multi-way selection (numeric or string selectors)
DO … END Simple block / infinite loop (DO FOREVER / DO LOOP)
DO WHILE / DO UNTIL Condition-controlled loops (combinable)
DO i = a TO b BY c Counted loop with start / limit / step
DO i = a UPTHRU/DOWNTHRU b Inclusive ascending / descending counted loop
DO i = … REPEAT … Loop driven by a repeat expression
DO i = v1, v2, … Loop over an explicit value list
LEAVE Exit a (optionally labeled) loop
ITERATE Skip to the next iteration of a (optionally labeled) loop
GOTO / GO TO Unconditional jump to a labeled statement

Condition handling

Statement Notes
ON condition Establish a handler for a PL/I condition, with an optional SNAP, SYSTEM, or block/statement body
SIGNAL condition Raise a named condition to invoke its handler

Supported conditions include ENDFILE, ERROR, KEY, CONVERSION, OVERFLOW, UNDERFLOW, FIXEDOVERFLOW, SIZE, ZERODIVIDE, INVALIDOP, SUBSCRIPTRANGE, STRINGRANGE, STRINGSIZE, UNDEFINEDFILE, and CHECK.

File & stream I/O

Statement Notes
OPEN Open a file with options (INPUT/OUTPUT/UPDATE, RECORD/STREAM, SEQUENTIAL/DIRECT, KEYED, PRINT, TITLE, LINESIZE, PAGESIZE)
CLOSE Close one or more files
READ Read a record INTO a variable, SET a pointer, or IGNORE records
WRITE Write a record FROM a variable, with optional KEYFROM
REWRITE Update an existing record FROM a variable, with optional KEYFROM
LOCATE Locate-mode output for direct access, with SET / KEYFROM
FLUSH Flush buffered output to a file (or all files)
GET Stream input — LIST / DATA / EDIT, from FILE or STRING, with SKIP/COPY
PUT Stream output — LIST / DATA / EDIT, to FILE or STRING, with PAGE/SKIP/LINE and edit formats

Assignment

Statement Notes
target = expression Assignment, with PL/I conversion and precision rules applied
+= -= *= /= Compound assignment
… , … = expr BY NAME Structure assignment matching members by name
Array / structure assignment Whole-array and structure-to-structure assignment, including dimension-across mapping

Program flow & termination

Statement Notes
STOP Terminate the program (or raise the runtime's program-exit path under a managed strategy)
EXIT Exit the current activation
; (null statement) No-operation; can carry a label to act as a GOTO target

Embedded sublanguages

Statement Notes
EXEC SQL … ; Embedded SQL, translated to run over standard JDBC — see Supported SQL Features
EXEC CICS … ; CICS command-level API, preserved and bridged by the runtime — see Supported CICS Features

Diagnostics & comments

Statement Notes
DISPLAY Write a message to the console, with optional REPLY
DELAY Pause execution for a specified interval
/* … */ comments Source comments, optionally carried into the generated Java

Preprocessor

%INCLUDE and PL/I macro directives are handled by the standalone preprocessor step, which resolves includes and expands macros before the compiler runs. (The compiler's own --include option is deprecated.)


Summary

The compiler translates the core PL/I procedural language: declarations and storage (DECLARE, ALLOCATE, FREE, PACKAGE), procedures and control transfer (PROCEDURE, ENTRY, CALL, RETURN, BEGIN), the full control- flow set (IF, SELECT, every DO form, LEAVE, ITERATE, GOTO), condition handling (ON, SIGNAL), file and stream I/O (OPEN/CLOSE, READ/WRITE/REWRITE/LOCATE/FLUSH, GET/PUT), assignment (including BY NAME and array/structure forms), and embedded EXEC SQL / EXEC CICS. This list is a summary — contact support to confirm a specific statement or clause.


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk