1. Home
  2. /
  3. Pli Typing Test
  4. /
  5. PL/I Counter and Theme Toggle

PL/I Counter and Theme Toggle - Pli Typing CST Test

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
Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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();
Coding works best on desktop or with an external keyboard.
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.

PL/I Counter and Theme Toggle — Pli Code

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

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();

Pli Language Guide

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.

Primary Use Cases

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

Notable Features

  • ▸Structured programming constructs
  • ▸Strong support for record and array data types
  • ▸Compiled for IBM mainframes
  • ▸Integrated input/output for batch processing
  • ▸Efficient memory and file handling

Origin & Creator

Developed by IBM in the 1960s, primarily as a high-level language for business and systems applications on mainframe computers.

Industrial Note

PLI remains in use in legacy IBM mainframe environments for maintaining mission-critical financial and administrative systems.

Quick 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

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

Practical Examples

  • ▸Generating financial reports
  • ▸Processing customer records in batch
  • ▸Updating mainframe database entries
  • ▸Calculating payroll or invoices
  • ▸Integrating with legacy enterprise 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

Strengths

  • ▸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

Limitations

  • ▸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

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

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

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.

30-Day Skill 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

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.

Project Structure

  • ▸Source/ - PLI source files
  • ▸Bin/ - compiled object code
  • ▸Lib/ - mainframe runtime libraries
  • ▸Docs/ - documentation and specifications
  • ▸Jobs/ - JCL scripts for batch execution

Monetization

  • ▸Enterprise legacy system maintenance
  • ▸Banking and financial software support
  • ▸Mainframe consulting and modernization
  • ▸Educational material for mainframe programming
  • ▸Historical study of procedural languages

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

Basic Concepts

  • ▸Variables, constants, and data types
  • ▸Procedures and modular routines
  • ▸Arrays, records, and tables
  • ▸Structured control flow: IF, DO, LOOP
  • ▸Input/output and batch processing

Official Docs

  • ▸IBM PL/I Language Reference
  • ▸IBM mainframe PLI compiler manuals
  • ▸Enterprise batch processing documentation

More Pli Typing Exercises

PL/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

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher