Back to Browse

Coding in RPG (IBM i/AS400). Using %Lookup.

943 views
Sep 21, 2025
22:20

In this video, I present the %LOOKUP built-in function in RPG, one of the most useful tools when working with arrays on IBM i. I explain how %LOOKUP works, the different variations it has, and how to use it in real programs. Step by step, I demonstrate practical examples, including: - Searching values in simple arrays. - Using %LOOKUP with *AUTO arrays. - Looking for values inside subarrays (from a specific position or until the end). - Searching within arrays of data structures, using a specific field as the target. Along the way, I also show how %LOOKUP can be combined with conditions and loops to make your code more flexible and readable. Whether you are just starting with RPG or you already use arrays daily, this video will give you a deeper understanding of %LOOKUP and how to apply it effectively in your programs. #IBMi #RPGLE #AS400 #IBMiDevelopment #programming #ibmchampion 0:00 - Introduction 1:07 - Starting with a simple program to show the basic usage of %LOOKUP 5:08 - Improving the program. Let's look for an element that is between two different positions in my array. 6:56 - Let's look for an element that is in my array, but from an element until the end. 7:25 - Sequenced arrays. 8:00 - Changing the program to use a sequenced array. 10:40 - Using %LOOKUPGT, %LOOKUPGE, %LOOKUPLT, %LOOKUPLE with sequenced arrays. 12:09 - Using %LOOKUP with arrays of data structures. 12:40 - Using "RPG Structure" to declare my structure. 17:43 - Using %LOOKUP to search for an element in my array using two different fields. 21:48 - Outro.

Download

0 formats

No download links available.

Coding in RPG (IBM i/AS400). Using %Lookup. | NatokHD