IBM BOB – The King of IBM-i Code Modernization?

  • Home
  • /
  • Blog
  • /
  • IBM BOB – The King of IBM-i Code Modernization?

April 9, 2026

If you have ever stared at a dusty fixed-format RPG III program from the 1990s and thought “there has to be a better way”, then IBM’s latest AI-powered sidekick might just be your new best friend.

Meet IBM BOB (yes, that’s the official name now – Project Bob has grown up). BOB is IBM’s AI-first development partner, built right into a VS Code based IDE and tuned specifically for IBM i workloads. It understands RPG, RPGLE, SQLRPGLE, CL, DDS, and a bunch more. Its super-power? Taking scary old legacy code and helping you drag it kicking and screaming into the modern free-format world without losing your sanity (or your job).

Your AI-Powered Development Partner

Why Bob feels like royalty for modernization

Traditional modernization projects usually involve weeks of head-scratching, lots of coffee, and the occasional GOTO-induced nightmare. Bob changes the game by:

  • Explaining what that mysterious subroutine actually does (in plain English, not RPG-ese)
  • Suggesting smart refactors, fixed-to-free, extracting procedures, adding proper error handling
  • Generating missing display files or service programs based on context
  • Helping you convert embedded SQL the right way

It is like having a very clever junior developer who never sleeps, never complains about your variable names, and actually knows the difference between RPG III and ILE.

Is IBM BOB really the undisputed monarch of IBM i code modernization, ruling over legacy systems with a mighty keyboard and a crown of neatly optimized syntax?

The fun part is watching Bob in action

I could bore you with more static code samples, but nothing beats seeing it live. Come with me while I fire up Bob, feed him a genuine piece of 1990s RPG code (complete with GOTO tags and monolithic subroutines), and let the AI loose.

Let’s test BOB’s mettle, by also asking him to take this old RPG400 program (written in the 1990’s) and ask for it to be upgraded to RPGLE /FREE and SQL RPGLE /FREE:

In the video above you just saw:

  • The original fixed-format mess
  • Bob analysing the logic
  • Step-by-step modernization to clean free-format RPGLE and SQL RPG
  • Subprocedures, better variable names, and even a few safety improvements

It is not magic, you still review and approve every change, but it sure feels close when Bob suggests a refactor that would have taken you half a day.

Here is BOB’s review of the upgrades it did:

RPGLE – BOB Code Modernization Complete

  1. Code Readability & Maintainability
    Eliminated all fixed-format code – Converted remaining C-specs to fully free-format RPG
    Removed GOTO statements – Replaced with structured return statements for cleaner flow
    Added control options – ctl-opt with modern settings
    Qualified data structure – sourceRecord qualified prevents naming conflicts
    Descriptive variable names – Changed file→pFileName, part→pPartnerName, rtn→pReturnCode
    Named constants – RC_SUCCESS, RC_PARTNER_MISMATCH, etc. replace magic strings
    Enhanced documentation – Clear purpose, return codes, and history
  2. Performance Optimization
    Proper file handling – Added usropn and explicit close operations
    Early exit strategy – return immediately when match found
    Efficient EOF checking – %eof() built-in function instead of indicators
  3. Best Practices & Patterns
    Modern parameter interface – dcl-pi replaces entry plist Procedure-based design – main() procedure for better organization Activation group control – actgrp(caller) for proper resource management
    Eliminated indicators – Removed *in50, *inlr in favor of modern constructs
    Removed obsolete directives – Eliminated /free and /end-free tags
  4. Error Handling & Edge Cases
    File empty check – Explicit handling with RC_FILE_EMPTY
    Resource cleanup – File properly closed in all exit paths
    Success return code – Added RC_SUCCESS for complete match
    Clear logic flow – Nested conditions simplified with early returns
    The code is now production-ready, maintainable, and follows modern RPG IV best practices.

SQLRPGLE – BOB’s Key SQL Improvements

  1. Embedded SQL Instead of Native I/O
    No file declarations – Uses SQL queries instead of dcl-f
    Direct data access – select statements replace READ operations
    SQL cursor – declare c1 cursor for efficient record retrieval
  2. Performance Benefits
    Optimized query – fetch first 1 row only stops after finding match
    SQL filtering – where substr() clauses reduce data retrieval
    Count check – select count(*) efficiently checks for empty file
    Database optimization – Leverages DB2 query optimizer
  3. Enhanced Error Handling
    SQL state checking – sqlState variable monitors all SQL operations
    New error code – RC_SQL_ERROR for SQL failures
    Proper cursor cleanup – close c1 in all exit paths
    No data handling – Explicit check for sqlState = ‘02000’
  4. Modern SQL Features
    String functions – substr() for field extraction
    Column aliases – Named result columns for clarity
    Declarative approach – SQL describes what to retrieve, not how
    Set-based operations – More efficient than record-level processing
  5. Advantages Over Native I/O
    Database independence – Can work with any SQL-accessible file
    Better scalability – SQL optimizer handles large datasets efficiently
    Easier maintenance – SQL queries are more readable than I/O operations
    Modern skillset – SQL knowledge is more transferable

You can grab the code samples here

My verdict so far

Is Bob the undisputed king of IBM i code modernization? It is certainly wearing the crown right now. It will not replace your brain (thank goodness), but it removes a huge amount of the grunt work and lets you focus on the interesting bits – architecture, business logic, and making the application actually better instead of just “less ancient”.

If you are sitting on a mountain of legacy RPG, now is a great time to give IBM BOB a spin. Start small: pick one program, ask it to explain the code, then try a controlled refactor. You will be amazed how quickly those old monsters start looking friendly again.

Got your own terrifying legacy program you want to modernize? Drop a comment below, I might even feature it in a future video.

Happy coding (and modernizing)!

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits.

Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day.

Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Subscribe NOW
7-day free trial

Take This Course with ALL ACCESS

Unlock your Learning Potential with instant access to every course and all new courses as they are released.
 [ For Serious Software Developers only ]

Online Learning for IBM i Software Technology Professionals

“The more that you read, the more things you will know. The more that you learn, the more places you’ll go.” – Dr. Seuss

>