Guru: Unlocking The Power Of %CONCAT And %CONCATARR In RPG
April 14, 2025 Gregory Simmons
When working with strings in RPG, especially in modern free-format code, the %CONCAT and %CONCATARR built-in functions (BIFs) offer efficient and readable solutions for combining strings. These functions simplify the process of concatenating multiple string values, making your code cleaner and easier to maintain. In this article, we will explore how they work and demonstrate their practical applications.
The %CONCAT BIF allows you to combine multiple strings. It’s a more efficient and readable alternative to traditional concatenation using the + operator.
Here’s a simple example:
**Free Ctl-Opt Main(CONCAT_1) ActGrp(*Caller); Dcl-Pr pause ExtProc('sleep'); time_to_sleep Uns(10) Value; End-Pr; Dcl-Proc CONCAT_1; Dcl-S firstName… Read more