Brewing with GitHub Copilot for RPG: How AI Can Modernize Development Without Burning the Coffee
☕ Today’s Coffee: Dunkin’ Caramel Me Crazy — smooth, sweet, with a caramel kick.
Modernizing RPG development is like brewing a good cup of coffee—you want
just the right balance of strength and smoothness. Done right, it energizes
your team and brings out rich new flavors. Done wrong, it leaves a bitter
aftertaste.
For IBM i RPG developers, GitHub Copilot isn’t just another shiny tool.
It’s a practical assistant that helps us:
- Understand legacy code faster
- Modernize RPG into free-form
syntax
- Catch errors before production
- Generate templates,
documentation, and build notes
- Support standards compliance
reviews
But like brewing coffee, you need the right process. The more details you
give Copilot, the better the outcome.
Why Pair Copilot with RPG?
For decades, RPG developers have relied on SEU, SDA, and fixed-format
code. It worked, and in many shops it still does. But just like sticking with
instant coffee forever, it limits the experience.
GitHub Copilot, when paired with VS Code or RDi, doesn’t rewrite your
world. Instead, it adds value in practical, daily ways:
- Explaining unfamiliar legacy
programs
- Generating boilerplate free-form
RPG code
- Reviewing code for consistency
and quality
- Writing documentation you’d
otherwise skip
- Even helping debug production
issues under tight deadlines
It’s not magic. It’s a helpful partner that lets you move faster while
staying in control.
Why Copilot Matters for RPG Developers
- Legacy Survival – Many shops are still running
30-year-old RPG programs. Copilot can summarize, explain, and document
those programs without hunting down the original author.
- Modernization – Converting from RPG II/III or
fixed-form to free-form can feel overwhelming. Copilot speeds it up with
suggestions, refactoring prompts, and SQL examples.
- Standards Compliance – Reviews aren’t fun. Copilot
can automate a first pass, flagging missing error handling, outdated
specs, or style issues.
- Productivity – Instead of staring at a blank
member, Copilot can generate scaffolding: service programs, subfiles,
stored procedures, or CLLE job control.
Prompt Categories You Can Use
Every Copilot session starts with a good prompt. Here are practical
categories:
1. Understanding Legacy Programs
- Act like a senior RPG developer.
Explain in plain language what this program does and its main business
logic.
- Act like a senior RPG developer.
Summarize subprocedures, control flow, and all files/tables used.
- Act like a senior RPG developer.
Identify legacy RPG II/III code and suggest free-form refactoring.
2. Pre-Code Review
- Act like a senior RPG developer.
Perform a pre-code review. List violations, outdated RPG formats, and
missing error handling.
- Act like a senior RPG developer.
Identify SELECT * SQL statements and un-externalized file specs.
3. Code Review
- Act like a senior RPG developer.
Conduct a full code review and categorize issues as critical, major, or
minor.
- Act like a senior RPG developer.
Produce a Markdown report of all violations.
4. Build Notes
- Act like a senior RPG developer.
Generate build notes for this program, including dependencies and
free-form status.
5. Code Generation
- Act like a senior RPG developer.
Generate a free-form RPGLE subprocedure with header comments, record
locking, and SQL error handling.
- Act like a senior RPG developer.
Generate a CLLE program that calls an RPGLE program with logging.
6. Documentation
- Act like a senior RPG developer.
Generate Markdown documentation: purpose, parameters, files, SQL, and
subprocedures.
- Act like a senior RPG developer.
Add inline comments for each subprocedure with inputs, outputs, and
errors.
- Act like a senior RPG developer.
Review this SQL stored procedure for error handling, dynamic SQL risks,
and performance considerations.
- Act like a senior RPG developer.
Reverse engineer this program. List subprocedures, legacy sections, SQL,
and compliance gaps.
- Act like a senior RPG developer.
Here are the production bug details and affected program. Find the likely
cause and propose a solution.
A Detailed Prompt for Standards-Based
Reviews
Sometimes you need more than a quick suggestion. You need a structured
review. Here’s a detailed prompt template:
Act like a senior RPG developer. Please review the attached code file and provide a compliance score based on our development standards. Use the exact format below and focus on issues that impact functionality, security, maintainability, and adherence to team standards. If you need additional context (standards doc, mod mark, or runtime assumptions), state what you need.
## Code Review: [FILENAME]
### ✅ Compliant Areas
[List what follows standards
correctly]
### ⚠️ Issues Found
#### Critical Issues
[Issues that could cause system
failures, data corruption, or security problems]
#### Major Issues
[Issues that violate important
standards but don't cause immediate failures]
#### Minor Issues
[Style, consistency, or
maintainability improvements]
### 📋 Recommendations
[Provide specific code fixes using
markdown code blocks with filepath comments]
### 📊 Standards Compliance Score: X%
**Summary:** [Brief overall
assessment]
Scoring Guidelines:
90–100%: Excellent
80–89%: Good
70–79%: Acceptable
60–69%: Poor
Below 60%: Unacceptable
Key Areas to Evaluate:
- Documentation
- Error handling
- Security
💡 Tip: The more details you add
to the prompt—standards doc, mod mark, business context—the sharper and more
useful the review becomes.
Final Sip
Using GitHub Copilot for RPG development is like brewing with Dunkin’
Caramel Me Crazy—it’s familiar, sweet, and keeps you going when deadlines are
tight.
The key is balance:
- Give Copilot clear, detailed
prompts
- Start small with code
explanations or reviews
- Use structured prompts for
modernization and compliance
- Always validate Copilot’s
suggestions before committing
Modernization doesn’t mean throwing away your RPG mastery—it means
amplifying it. Copilot is the extra shot of espresso that makes legacy code
understandable, maintainable, and ready for the future.
☕ Follow The RPG Blend for more practical strategies, prompt
examples, and leadership insights on IBM i modernization.
Comments
Post a Comment