Refactoring RPGLE: Scott Klement’s Copybooks in Free Format RPG
If you’ve ever stared at a wall of fixed-format RPG code and wondered how to bring it into the 21st century, you’re not alone.
In this video, let’s walk through the process of upgrading Scott Klement’s RPGLE copybooks, transforming legacy column-based RPG into sleek, readable free-format RPGLE.
Why Modernize?
Legacy RPG code, while powerful, can be rigid and difficult to maintain. Fixed-format syntax demands strict column placement, making even simple changes a headache. Free-format RPGLE, on the other hand, offers: cleaner syntax, easier readability, better integration with modern tools like VS Code, and enhanced maintainability for future development
Ready? Let’s get hands-on and practical looking at:
- Analyzing legacy copybook structures: Understanding how data structures, prototypes, and procedures are defined in fixed-format RPG.
- Converting to free-format syntax: Step-by-step transformation of code blocks while preserving logic and functionality.
- Ensuring compatibility: Tips for maintaining seamless integration with existing applications.
- Best practices: Writing cleaner, more maintainable RPGLE code using modern conventions. Use indentation and whitespace to make your free-format code more readable. Leverage built-in RPGLE functions to simplify logic.
Don’t just convert your code, refactor your code!
Take the opportunity to improve structure and clarity. In modern RPGLE and CLLE we have many, many new opcodes that lets us do things natively in a single line of code, which used to require entire subroutines in old RPG3 and RPG400. Modernizing and refactoring old code is all about rethinking the logic, streamlining the structure, and embracing modern opcodes that make your code cleaner, faster, and easier to maintain.
Whether you’re a seasoned IBM i developer or just starting your RPG journey, this video might help?
Watch the full video and start modernizing your RPGLE copybooks today.

Hi.
I’m trying to use the SEU editor. Old code is generally in the fixed format, but I want to learn the free format for modernization and easier reading. I can’t connect to AS400 with VSCode, I get an SSH error, and I can’t get past this. Could you please help me?
I watched a video of yours, and all the information is correct, but I couldn’t log in. I tried my company’s test server, but it didn’t work. I tried signing up for Pub400 and still nothing. I’m asking for your help.
Is your SSH Server running on our company’s test server?
Log on and type this STRTCPSVR SERVER(*SSHD)
https://www.nicklitten.com/course/ibm-i-ssh-daemon/
Yes, it works.
But when I click on the Open Source Package Management section in ACS, it asks me for a user and password. I enter them correctly and get an error. I can’t get past this step.
I will send you a message from LinkedIn with the error image
Is your profile powerful enough? You need *ALLOBJ to install Open Source Packages…