Learn to program RPG for beginners

About Learn to program RPG for beginners

Come with me while we talk about the IBM RPG (Report Program Generator) language. We will step through some basics of the language, discuss some history and even get our hands dirty with a little programming. It's an old language and has evolved a lot over the years -- modern RPG is unrecognizable from the old column based code from the 1980's. Let's dive in and start at the beggining.
This will be fun!
Honest ;)

Module Content

Come with me while we talk about the IBM RPG (Report Program Generator) language. We will step through some basics of the language, discuss some history and even get our hands dirty with a little programming. It's an old language and has evolved a lot over the years -- modern RPG is unrecognizable from the old column based code from the 1980's. Let's dive in and start at the beggining. This will be fun! Honest ;)

IBM i RPG - So much more than a Report Program Generator

MEMBERS ONLY

For those who are just exploring the wonderful RPG language - there are lots of wonderful *FREE* guides out there in internet land. I've pulled them together here for easy reference

General info about RPG - This chapter introduces you to general information about RPG source code.

Variables and procedures - This chapter introduces you to defining constants, variables and prototypes.

Introduction to Files / Tables - This chapter introduces you to using files with RPG

Text lesson

Display files - This chapter introduces you to using display files, also called "workstation files"

Solutions to RPG exercises - every question has an answer

Learning to code is most effective if you start with some clean coding standards. So let's start building those foundations properly with advice for RPG, RPG400 and modern ILE RPG programmers.

Coding in Free-Form RPG IV - a deep dive - based on a beginner’s tutorial By Barbara Morris on Midrange.com

Writing RPG ILE Programs on your IBM Power System

MEMBERS ONLY

Let's have a look at the most simple version of an old RPG program. A 2 line HELLO WORLD example, written in column based RPG400 (aka RPG3) which will simply send a message to the screen. We can do this using SEU, Source Entry Utility, and integrated text editor on your IBM i Power System - which has remained unchanged for over 20 years :)

Welcome back to part 2 of "programming like an AS400 Noob" ;) In this video we can look at our original simple HELLO WORLD code sample and uplift it to RPGLE format. We can have a quick spin through the PDM development environment and look at some command line tricks.

Yep. You guessed it! In this thrilling episode we are going to take that old column based RPGLE code and set it free. Take our first tentative steps into the world of free format RPG code.

In this, the penultimate episode of "playing with smelly old RPG code" we take the final step into the world of modern RPG code layout. Introducing the **FREE command line, we finally tell the IBM i Compiler that we are not messing about.

Welcome back to final episode of this "RPG for complete noobies" series. Here we will poke around in some modern RPG code, and use Microsoft code editor (Visual Studio Code) to edit the RPG in real time on our IBM i Power System. How does VSCODE know about RPG? By using the marvelous CODE4I plugin of course!

Let's upgrade this super simple HELLO WORLD program to add some more standards and functions

Beginners Overview of an RPG400 File Update Program

MEMBERS ONLY

Come with me, while I play with someone else's old RPG400 code which performs a *PF file update and allows paging forward and backward through the data... then we will refactor that old ISERIES COLUMN BASED RPG to modern IBM i RPG ILE Freeformat and test it. Assuming that works... then we will upgrade the *PF to an *SQL TABLE and prove that it works with the program without needing any recompiles. Sounds like a fun Friday evening ;)

Are you a novice IBM RPG programmer, or perhaps just a techno junkie who likes to learn about new programming languages? Then this breakdown of some other programmers old RPG400 file update program might be something that you will enjoy. I hope you do. I get strange enjoyment from playing with chunks of code like this... and figuring out what makes them tick.

Let's take a deep dive into this RPG400 program to try and figure out how it works. This will mean looking at the file and display setting to understand the relationship with the RPG code. We are going through it line by line to understand it, compile it and test it. After that... then we can look at upgrading the code to modern FREE FORMAT RPG and upgrade the physical file to an SQL TABLE. Put on your dive mask... and dive in!

Time to dive into the existing RPG400 (Column Based Old Style RPG) and set it FREE. This means using Visual Studio Code, and the Code4i plugin, to automatically upgrade the old legacy code style to modern free format RPG ILE. This does a pretty good job easily upgrading 90% of the code - so come with me while I walk through the code base and manually fix the few lines it couldnt automatically handle. SPOILER ALERT - don't laugh at me when I make RPG conversion mistakes. They are deliberate. Honest ;)

Come with me, while we trawl through this old code and update to a newer style of subroutine - the much lauded RPG SUB PROCEDURE

Let's convert our physical file to an SQL Table two ways, once using my toolkit command from PROJEX4i, or for those that don't want to download and install the toolkit onto their IBM i System, we will also use IBM i Access Client Solutions itself. We will check the file record format level ID to prove that the new TABLE looks just like the old PF and all existing RPG code will simply run over the new TABLE without needing any recompiles.

Ready to learn?
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>