Learn Pli-mainframe - 10 Code Examples & CST Typing Practice Test
PLI (Programming Language One) Mainframe is a procedural programming language primarily used on IBM mainframe systems for business and administrative applications. It emphasizes structured, readable code for transaction processing, batch jobs, and legacy enterprise systems.
Learn PLI-MAINFRAME with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
PL/I Simple Display
HELLO: PROCEDURE;
PUT SKIP LIST('Hello, PL/I World!');
END HELLO;
Display a simple greeting message.
PL/I Variable Assignment
ASSIGN-VARS: PROCEDURE;
DECLARE A FIXED BINARY(31);
DECLARE B FIXED BINARY(31);
A = 10;
B = 20;
PUT SKIP LIST('A + B = ', A + B);
END ASSIGN-VARS;
Assign values to variables and display the result.
PL/I IF-ELSE Example
CHECK-NUMBER: PROCEDURE;
DECLARE NUM FIXED BINARY(31) INIT(-5);
IF NUM >= 0 THEN
PUT SKIP LIST('Number is positive.');
ELSE
PUT SKIP LIST('Number is negative.');
END CHECK-NUMBER;
Check if a number is positive or negative.
PL/I DO Loop Example
LOOP-EXAMPLE: PROCEDURE;
DECLARE I FIXED BINARY(31);
DO I = 1 TO 5;
PUT SKIP LIST('Number: ', I);
END;
END LOOP-EXAMPLE;
Print numbers from 1 to 5 using DO loop.
PL/I Array Processing
ARRAY-SUM: PROCEDURE;
DECLARE NUMS(5) FIXED BINARY(31) INIT(1,2,3,4,5);
DECLARE TOTAL FIXED BINARY(31) INIT(0);
DO I = 1 TO 5;
TOTAL = TOTAL + NUMS(I);
END;
PUT SKIP LIST('Total Sum: ', TOTAL);
END ARRAY-SUM;
Sum values in an array of integers.
PL/I String Concatenation
STRING-CONCAT: PROCEDURE;
DECLARE FIRST CHAR(10) INIT('John');
DECLARE LAST CHAR(10) INIT('Doe');
DECLARE FULL CHAR(21);
FULL = FIRST || ' ' || LAST;
PUT SKIP LIST('Full Name: ', FULL);
END STRING-CONCAT;
Concatenate first and last name into full name.
PL/I File Write Example
FILE-WRITE: PROCEDURE;
DECLARE F FILE OUTPUT;
OPEN FILE(F) TITLE('output.txt');
PUT FILE(F) LIST('Hello, PL/I File!');
CLOSE FILE(F);
END FILE-WRITE;
Write a simple message to a file.
PL/I Substring Example
SUBSTRING-EX: PROCEDURE;
DECLARE STR CHAR(20) INIT('PL/I Programming');
DECLARE SUB CHAR(10);
SUB = SUBSTR(STR, 1, 3);
PUT SKIP LIST('Substring: ', SUB);
END SUBSTRING-EX;
Extract a substring from a string variable.
PL/I Conditional Assignment
COND-ASSIGN: PROCEDURE;
DECLARE X FIXED BINARY(31) INIT(5);
DECLARE Y FIXED BINARY(31);
Y = (X > 0) ? 100 : -100;
PUT SKIP LIST('Y = ', Y);
END COND-ASSIGN;
Assign a value based on a condition.
PL/I Multi-dimensional Array
MATRIX-EX: PROCEDURE;
DECLARE MAT(2,2) FIXED BINARY(31) INIT((1,2),(3,4));
DO I = 1 TO 2;
DO J = 1 TO 2;
PUT SKIP LIST('MAT(', I, ',', J, ') = ', MAT(I,J));
END;
END;
END MATRIX-EX;
Initialize and display a 2x2 matrix.
Frequently Asked Questions about Pli-mainframe
What is Pli-mainframe?
PLI (Programming Language One) Mainframe is a procedural programming language primarily used on IBM mainframe systems for business and administrative applications. It emphasizes structured, readable code for transaction processing, batch jobs, and legacy enterprise systems.
What are the primary use cases for Pli-mainframe?
Batch processing of financial transactions. Payroll and accounting applications. Report generation and data summarization. Legacy system maintenance and modernization. Integration with mainframe DB2, CICS, or IMS systems
What are the strengths of Pli-mainframe?
Highly reliable for large-scale batch processing. Optimized for IBM mainframe environments. Mature language with decades of enterprise use. Structured programming ensures maintainable code. Strong integration with existing mainframe tools
What are the limitations of Pli-mainframe?
Limited modern GUI and web integration. Declining community and fewer new developers. Less flexible for object-oriented or modern programming paradigms. Dependency on legacy mainframe infrastructure. Debugging tools may be less intuitive compared to modern IDEs
How can I practice Pli-mainframe typing speed?
CodeSpeedTest offers 10+ real Pli-mainframe code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.