Back to: ILE RPG in Easy Bytes
In Unit 6, you learn how to process, manipulate, combine, and inspect character-based information by using expressions. You’ll become familiar with the rich set of built-in functions that ILE RPG uses with character data. In addition, you learn how to convert numeric data to character data so that you can use numeric data with character processing.
This course is a unit of the ILE RPG in Easy Bytes series, a complete introductory ILE RPG programming self-guided tutorial.
- Before starting this course you must complete the required prerequisite course: 5. Numeric Operations – ILE RPG in Easy Bytes
One-Time Payment
Members Only
Instead of paying for each unit individually, you may purchase a membership which will automatically enroll you at a discount in the entire “ILE RPG in Easy Bytes” series.
Processing Character Data
But character data also plays a large part in many applications. We’ve already used the Eval (Evaluate expression) operation to evaluate arithmetic expressions. Now let’s look at how to assign values to character fields.
These operations also provide a flexible and powerful method for joining character values together; this process is called concatenation. Use the + operator to concatenate two or more character values—which can be variables, literals or constants—and assign the resulting new character value to a variable. A single concatenation expression can contain as many + operators and character operands as needed to accomplish a desired concatenation.
ILE RPG also supports many built-in functions that you can use along with character expressions. These provide new functions that aren’t available by coding simple concatenation. Most of the built-in functions that return character values return variable-length character values.
Move is a fixed-format operation code (not allowed in free-format RPG) that’s prevalent in legacy code. Move assigns characters from Factor 2 to the Result field: *..
- Before starting this course you must complete the required prerequisite course: 5. Numeric Operations – ILE RPG in Easy Bytes