Repository navigation
Variables and Constants
Daniel Long edited this page Sep 24, 2026
·
2 revisions
DCL-S counter INT(10);
DCL-S name VARCHAR(50) INZ('Default');
DCL-S rate PACKED(7:2) INZ(15.50);
DCL-S isActive IND INZ(*ON);DCL-C MAX_SIZE 100;
DCL-C GREETING 'Hello';
DCL-C PI 3.14159;| Constant | Description |
|---|---|
*BLANKS |
Empty string / spaces |
*ZEROS |
Numeric zero or string of zeros |
*HIVAL |
Maximum value for the type |
*LOVAL |
Minimum value for the type |
*ON |
Boolean true / '1' |
*OFF |
Boolean false / '0' |
*NULL |
Null pointer |
*ALL'x' |
Repeated character pattern |
total = price * qty;
total += tax; // total = total + tax
count -= 1;
amount *= 1 + rate; // amount = amount * (1 + rate)
share /= 3;
area **= 2;
name += '!'; // concatenation, for strings
EVAL(H) share /= 3; // extenders work as with EVAL+=, -=, *=, /= and **= take everything to their right as one
operand. They work anywhere an assignment does: arrays, subfields, and
fixed-format EVAL.
- Installation
- Quick Start
- CLI Reference
- Language Basics
- Data Types
- Variables and Constants
- Data Structures
- Arrays
- Varying-Dimension Arrays
- Control Flow
- Procedures
- Procedure Overloading
- Built-In Functions
- Error Handling
- Operation Extenders
- Enumerations
- Program Status Data Structure
- Data Areas
- SND-MSG
- Embedded SQL
- Record-Level Access
- Display Files (WORKSTN)
- Program-Described Files (I-Specs and O-Specs)
- DATA-INTO and DATA-GEN
- XML-INTO
- Fixed-Format Source
- Database Connections
- Multi-Module Programs
- Environment Variables
- Testing
- Complete Example: Employee Report
- IBM i Conformance Results
- IBM i Execution Results