Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master themPractice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM levelTournamentsLive coding speed tournamentsArcade GamesZType, Overkill Survival, Glyphica & moreGamificationXP, coins, badges & quests
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFree ToolsWPM calculator, typing speed report & moreFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & missionSupportGet help — Pro users get priorityContactGet in touch with the team
Pricing
  1. Home
  2. /
  3. Learn
  4. /
  5. Pli

Learn Pli - 10 Code Examples & CST Typing Practice Test

PLI (Programming Language One) is a procedural, compiled language designed for business and systems programming, particularly for large-scale data processing and legacy IBM mainframe environments.

View all 10 Pli code examples →
PL/I Counter and Theme TogglePL/I Random Number GeneratorPL/I Todo ListPL/I Dice RollerPL/I Countdown TimerPL/I Prime CheckerPL/I Temperature ConverterPL/I Shopping CartPL/I Name GreetingPL/I Stopwatch

Learn PLI with Real Code Examples

Updated Nov 21, 2025

Explain

PLI was created to handle structured programming for commercial applications on IBM mainframes.

It combines features from FORTRAN and ALGOL, with strong support for structured control, record handling, and input/output.

It was widely used in banking, insurance, and enterprise resource planning systems due to its reliability and performance on mainframes.

Core Features

Procedures and subroutines

Arrays, tables, and records

Structured loops and conditionals

Built-in file and print handling

Static typing with mainframe-optimized compilation

Basic Concepts Overview

Variables, constants, and data types

Procedures and modular routines

Arrays, records, and tables

Structured control flow: IF, DO, LOOP

Input/output and batch processing

Project Structure

Source/ - PLI source files

Bin/ - compiled object code

Lib/ - mainframe runtime libraries

Docs/ - documentation and specifications

Jobs/ - JCL scripts for batch execution

Building Workflow

Write PLI source files with .pli extension

Define and implement procedures

Compile using mainframe PLI compiler

Submit jobs for batch execution

Verify results and debug as needed

Difficulty Use Cases

Beginner: small data processing scripts

Intermediate: multi-procedure business applications

Advanced: mainframe batch system programming

Expert: maintaining large-scale legacy enterprise applications

Enterprise: mission-critical banking or insurance systems

Comparisons

More structured than early COBOL

Optimized for mainframe batch processing

Less portable than modern languages

Similar purpose as PL/I but IBM-focused

Strong legacy presence in banking and enterprise

Versioning Timeline

1964-1965 - IBM develops PL/I and variants for enterprise

1960s-1970s - PLI widely adopted for mainframe batch systems

1980s - Legacy banking and insurance systems solidified use

1990s-2000s - Integration with modern mainframe technologies

2025 - Maintained in legacy enterprise and educational environments

Glossary

Record: structured data type with fields

Procedure: reusable subroutine

Array/Table: indexed collection of elements

Batch job: program executed in mainframe job queue

JCL: Job Control Language for compiling and running jobs

Installation Setup

Access IBM mainframe or compatible PLI development environment

Upload source files to mainframe

Use JCL (Job Control Language) to compile PLI programs

Set up environment variables for compiler paths

Run sample batch programs to verify setup

Environment Setup

Access IBM mainframe environment

Upload source files and libraries

Configure JCL for batch jobs

Compile test programs

Execute sample jobs to verify correctness

Config Files

*.pli - PLI source files

Lib/ - mainframe runtime and libraries

Bin/ - compiled object code

Docs/ - documentation and specifications

Jobs/ - JCL scripts for batch execution

Cli Commands

COMPILE file.pli - compile PLI source

RUN program - execute compiled code

SUBMIT job.jcl - submit batch job

DEBUG file.pli - debug procedures

LIST file.pli - view compiled program details

Internationalization

Character data handled via ASCII

No built-in modern localization support

Batch output can be adapted manually

Used primarily in English-language systems

Legacy systems may have custom encoding

Accessibility

Readable procedural syntax

Structured records and arrays

Strong typing ensures fewer runtime errors

Mainframe-oriented workflow learning curve

Educational for understanding legacy enterprise systems

Ui Styling

No native GUI support

Text-based output and print handling

Batch reports for formatted results

External visualization requires modern tools

Focus on structured, reliable output

State Management

Global and local variables managed in mainframe memory

Record and array structures maintain data state

Procedures encapsulate operations

Batch jobs manage overall program flow

Runtime ensures sequential execution and I/O consistency

Data Management

Primitive types: FIXED BIN, FLOAT, CHAR

Structured types: RECORD, TABLE/ARRAY

File I/O integrated with mainframe systems

Batch job inputs and outputs handled via datasets

Memory and data accessed efficiently by compiler

Architecture

PLI source code (.pli files)

Compiled using IBM mainframe PLI compiler

Executable object code for mainframe environments

Integrated runtime libraries for I/O and system calls

Batch job control through mainframe operating system

Rendering Model

Parse PLI source code

Compile procedures and modules into object code

Submit jobs via JCL to mainframe OS

Runtime handles file and batch operations

Monitor execution and output for correctness

Architectural Patterns

Procedural decomposition

Record and table-based data structures

Modular procedures for reuse

Batch processing control flow

Integration with legacy mainframe services

Real World Architectures

Legacy banking batch systems

Insurance claim processing

Government administrative applications

Enterprise reporting systems

Data migration and integration with modern systems

Design Principles

Structured and modular programming

Optimized for mainframe batch processing

Static typing for reliability

Efficient memory and file handling

Focused on business and enterprise workflows

Scalability Guide

Modularize procedures for reusability

Keep arrays and tables manageable

Optimize batch job processing

Maintain proper file and memory management

Design for long-running mainframe workloads

Migration Guide

Port PLI code to COBOL or modern PL/I-compatible languages

Adapt batch jobs for modern mainframe tools

Replace outdated data handling practices

Test records and arrays for consistency

Verify job outputs against legacy results

Performance Notes

Compiled PLI code is optimized for mainframe execution

Efficient for large-scale batch processing

Memory and file handling optimized for IBM OS

Low runtime overhead compared to interpreted languages

Suitable for high-volume transactional systems

Security Notes

Access control enforced at mainframe level

Proper data handling prevents batch processing errors

Type safety minimizes runtime failures

Legacy systems may lack modern security practices

Secure coding depends on disciplined program design

Monitoring Analytics

Check batch job logs

Monitor output datasets

Debug procedure errors

Trace record and table manipulations

Profile job performance for efficiency

Code Quality

Follow consistent naming for variables and procedures

Comment batch job logic clearly

Validate record and table manipulations

Unit test procedures when possible

Maintain modular, structured code

Practical Examples

Generating financial reports

Processing customer records in batch

Updating mainframe database entries

Calculating payroll or invoices

Integrating with legacy enterprise systems

Troubleshooting

Check syntax for structured loops

Verify record and table handling

Ensure correct file paths and job control

Debug procedure calls and data assignments

Monitor batch job logs for runtime errors

Testing Guide

Unit test procedures individually

Validate record and table manipulations

Check batch output against expected results

Use sample datasets for functional verification

Monitor job logs for errors

Deployment Options

Compile and execute on IBM mainframe

Distribute batch jobs via JCL

Maintain source and object code for archival

Run in production mainframe environments

Integrate with other enterprise systems via APIs or batch output

Tools Ecosystem

IBM PLI compiler

Mainframe editors (ISPF, TSO) or text editors

Job Control Language (JCL) scripts

Debugger tools for mainframe batch jobs

Documentation and legacy code archives

Integrations

Mainframe databases (DB2, IMS)

Batch processing and reporting systems

Legacy enterprise applications

Financial and insurance software systems

Data migration and modernization tools

Productivity Tips

Use modular procedures to reduce redundancy

Document batch job steps

Leverage record structures for clarity

Test small modules before full job submission

Maintain consistent naming conventions

Challenges

Learning mainframe environment and JCL

Debugging large batch processing programs

Maintaining type safety and data integrity

Integrating with legacy databases

Understanding historical design patterns

Learning Path

Understand mainframe environment and JCL

Learn basic PLI syntax and procedures

Practice arrays, records, and tables

Develop small batch processing programs

Study legacy systems and integration patterns

Skill Improvement Plan

Week 1: PLI syntax and variable types

Week 2: Arrays, records, and tables

Week 3: Procedures and modular routines

Week 4: Batch job creation and execution

Week 5: Enterprise mainframe application maintenance

Interview Questions

What is PLI and what was it designed for?

How does PLI differ from COBOL and FORTRAN?

Explain structured programming in PLI.

What are the typical applications of PLI?

How do you maintain legacy PLI systems?

Cheat Sheet

DECLARE x FIXED BIN(31); - declare integer variable

DECLARE rec RECORD (field1 FIXED BIN(31), field2 CHAR(10));

PROCEDURE name(); - define procedure

IF condition THEN … ELSE … ENDIF; - conditional

DO i = 1 TO 10; … ENDDO; - loop

Books

Programming in PL/I / PLI by IBM

Structured Programming with PLI

Enterprise Batch Processing with PLI

Mainframe Systems Programming with PLI

Legacy IBM Software Development Practices

Tutorials

PLI syntax and variable types

Procedures, records, and tables

Loops and conditionals

File and batch processing

Developing enterprise mainframe applications

Official Docs

IBM PL/I Language Reference

IBM mainframe PLI compiler manuals

Enterprise batch processing documentation

Community Links

IBM mainframe forums and user groups

Legacy enterprise system communities

Archived PL/I/PLI tutorials

Corporate mainframe teams

University archives for legacy programming

Community Support

IBM legacy programming forums

Mainframe and enterprise user groups

University archives with PLI documentation

Internal corporate mainframe teams

Historical programming resources

Monetization

Enterprise legacy system maintenance

Banking and financial software support

Mainframe consulting and modernization

Educational material for mainframe programming

Historical study of procedural languages

Future Roadmap

Legacy-focused maintenance and modernization

Education and training on mainframe programming

Integration with modern mainframe tools

Preservation of enterprise batch systems

Transition strategies for modernization to newer languages

When Not To Use

Modern web, mobile, or GUI applications

Cross-platform development outside IBM mainframes

Rapid prototyping or scripting tasks

Machine learning or modern data analytics

Systems requiring modern community support or libraries

Final Summary

PLI is a procedural, compiled language optimized for IBM mainframes.

Used for structured business and batch processing applications.

Strong support for records, arrays, and modular procedures.

Mostly relevant today for legacy enterprise systems.

Combines reliability, structured programming, and mainframe efficiency.

Faq

Is PLI still used?

Yes, primarily for legacy IBM mainframe systems.

Can PLI handle modern computing tasks?

Not efficiently; it is optimized for batch and enterprise processing.

Is PLI portable?

Mostly limited to IBM mainframe environments.

Does PLI support structured programming?

Yes, with procedures, loops, and conditionals.

What industries still use PLI?

Banking, insurance, government, and other mainframe-reliant sectors.

Code Sample Descriptions

1

PL/I Counter and Theme Toggle

DECLARE count FIXED BINARY(31) INITIAL(0);
DECLARE isDark BIT(1) INITIAL('0'B);

UPDATEUI: PROCEDURE OPTIONS(MAIN);
    PUT SKIP LIST('Counter: ', count);
    IF isDark = '1'B THEN
        PUT SKIP LIST('Theme: Dark');
    ELSE
        PUT SKIP LIST('Theme: Light');
    END;
END UPDATEUI;

INCREMENT: PROCEDURE;
    count = count + 1;
    CALL UPDATEUI();
END INCREMENT;

DECREMENT: PROCEDURE;
    count = count - 1;
    CALL UPDATEUI();
END DECREMENT;

RESET: PROCEDURE;
    count = 0;
    CALL UPDATEUI();
END RESET;

TOGGLETHEME: PROCEDURE;
    IF isDark = '0'B THEN
        isDark = '1'B;
    ELSE
        isDark = '0'B;
    END;
    CALL UPDATEUI();
END TOGGLETHEME;

/* Simulate actions */
CALL UPDATEUI();
CALL INCREMENT();
CALL INCREMENT();
CALL TOGGLETHEME();
CALL DECREMENT();
CALL RESET();

Demonstrates a simple counter with theme toggling using PL/I variables and procedures.

Let’s Try →
2

PL/I Random Number Generator

DECLARE i FIXED BINARY(31);
DECLARE num FIXED BINARY(31);
DO i = 1 TO 3;
    num = RANDOM(100) + 1;
    PUT SKIP LIST('Random', i, ':', num);
END;

Generates random numbers between 1 and 100 and prints them.

Let’s Try →
3

PL/I Todo List

DECLARE todos CHAR(20) DIM(10);
DECLARE count FIXED BINARY(31) INITIAL(0);

ADD: PROCEDURE(task);
    todos(count) = task;
    count = count + 1;
    PUT SKIP LIST('Todos count: ', count);
END ADD;

REMOVE: PROCEDURE(idx);
    DO i = idx TO count-2;
        todos(i) = todos(i+1);
    END;
    count = count - 1;
END REMOVE;

/* Simulate actions */
CALL ADD('Buy milk');
CALL ADD('Write PL/I code');
CALL REMOVE(1);

Maintains a simple todo list with add and remove functionality.

Let’s Try →
4

PL/I Dice Roller

DECLARE i FIXED BINARY(31);
DECLARE roll FIXED BINARY(31);
DO i = 1 TO 3;
    roll = RANDOM(6) + 1;
    PUT SKIP LIST('Roll', i, ':', roll);
END;

Rolls a six-sided dice three times.

Let’s Try →
5

PL/I Countdown Timer

DECLARE count FIXED BINARY(31) INITIAL(5);
DO WHILE(count >= 0);
    PUT SKIP LIST('Countdown:', count);
    count = count - 1;
END;
PUT SKIP LIST('Done!');

Counts down from 5 to 0.

Let’s Try →
6

PL/I Prime Checker

DECLARE nums FIXED BINARY(31) DIM(3) INIT(7,10,13);
DECLARE n,i FIXED BINARY(31);
DECLARE isPrime BIT(1);

DO n = 1 TO 3;
    isPrime = '1'B;
    DO i = 2 TO nums(n)-1;
        IF nums(n) MOD i = 0 THEN isPrime = '0'B;
    END;
    IF isPrime = '1'B THEN PUT SKIP LIST(nums(n), 'is Prime')
    ELSE PUT SKIP LIST(nums(n), 'is Not Prime');
END;

Checks if numbers are prime.

Let’s Try →
7

PL/I Temperature Converter

DECLARE c FIXED DEC(7,2);
DECLARE f FIXED DEC(7,2);

c = 25; f = c*9/5+32; PUT SKIP LIST('25°C =', f, '°F');
f = 77; c = (f-32)*5/9; PUT SKIP LIST('77°F =', c, '°C');

Converts Celsius to Fahrenheit and Fahrenheit to Celsius.

Let’s Try →
8

PL/I Shopping Cart

DECLARE cart CHAR(20) DIM(10);
DECLARE prices FIXED BINARY(31) DIM(10);
DECLARE count FIXED BINARY(31) INITIAL(0);

ADDITEM: PROCEDURE(item, price);
    cart(count) = item;
    prices(count) = price;
    count = count + 1;
END ADDITEM;

REMOVEITEM: PROCEDURE(idx);
    DO i = idx TO count-2;
        cart(i) = cart(i+1);
        prices(i) = prices(i+1);
    END;
    count = count -1;
END REMOVEITEM;

CALL ADDITEM('Apple',2);
CALL ADDITEM('Banana',3);
CALL REMOVEITEM(0);

Adds and removes items in a shopping cart with total cost.

Let’s Try →
9

PL/I Name Greeting

GREET: PROCEDURE(name);
    PUT SKIP LIST('Hello,', name, '! Welcome!');
END GREET;

CALL GREET('Saurav');
CALL GREET('Alice');
CALL GREET('Bob');

Greets users by name.

Let’s Try →
10

PL/I Stopwatch

DECLARE time FIXED BINARY(31) INITIAL(0);
DO WHILE(time < 5);
    PUT SKIP LIST('Stopwatch:', time, 'seconds');
    time = time + 1;
END;
PUT SKIP LIST('Done!');

Simulates a stopwatch incrementing seconds.

Let’s Try →

Frequently Asked Questions about Pli

What is Pli?

PLI (Programming Language One) is a procedural, compiled language designed for business and systems programming, particularly for large-scale data processing and legacy IBM mainframe environments.

What are the primary use cases for Pli?

Large-scale batch processing. Business and financial systems. Mainframe application maintenance. Data processing for enterprises. Legacy system integration and updates

What are the strengths of Pli?

Highly reliable for business-critical applications. Optimized for IBM mainframes. Structured syntax reduces errors. Good for batch and report processing. Supports modular programming with procedures

What are the limitations of Pli?

Mainframe-dependent and outdated for modern platforms. Limited modern tooling or IDE support. Not suitable for web, mobile, or GUI applications. Smaller community compared to modern languages. Steeper learning curve for new programmers

How can I practice Pli typing speed?

CodeSpeedTest offers 10+ real Pli code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.

Learn Other Programming Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypherGremlinPartiqlHaskellElixirFsharpView all languages →
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Legal & Support

Pro ⚡ PricingContactPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.