- Home
- Skills
- Technical Documentation
- as400 source analysis
as400 source analysis
Analyze and document IBM i (AS/400) RPG and CL source code, DDS layouts, and program call chains.
$2
Works with the AI Agents you already use
as400 source analysis
Example session with this skill installed
Analyze the RPGLE program INV500R in PRODLIB/QRPGLESRC. It handles inventory updates. Summarize the files used and the main calculation logic.
- Read your context and instructions
- Compiled the as400 source analysis
I have analyzed the source for PRODLIB/QRPGLESRC(INV500R). This is a fixed-format RPGIV program last changed on 2023-11-15.
Program Analysis: PRODLIB/QRPGLESRC(INV500R)
Purpose: Processes inventory transaction records to update warehouse balances and log history.
Parameters:
P_PART(Char 15): Part NumberP_QTY(Packed 7,2): Transaction QuantityP_TYPE(Char 1): Transaction Type (A=Add, S=Subtract)
Files:
| Name | Access | Key | Purpose |
|---|---|---|---|
| INVBAL | Update | PART, WHSE | Warehouse balance master |
| INVHST | Output | - | Transaction history log |
| PARTMST | Input | PART | Validation of part existence |
Main Flow:
- Validates
P_PARTagainstPARTMSTusing aCHAINoperation (Line 45). - Performs
SETLLandREADEonINVBALto locate the specific part/warehouse record (Lines 52-58). - If found, updates
QTYOHbased onP_TYPE. Logic usesEVALwith anIFblock (Lines 60-72). - Writes a new record to
INVHSTcontaining a timestamp and the old/new balance values. - Sets
*INLRto on and returns.
Business Rules:
Line 65: If P_TYPE is 'S' and QTYOH would fall below zero, the program issues a DSPLY message but still proceeds with a negative balance.
- Line 80: Transactions for part numbers starting with 'TEST' are ignored and not logged to
INVHST.
Anomalies:
- Hard-coded value: The warehouse ID '01' is hard-coded in the
KLISTforINVBAL(Line 50). - Dead Code: Subroutine
*INZSRcontains a call toERR_LOGthat is commented out with a*in column 7.
Next steps:
- Check
PRODLIB/DDS(INVBAL)to verify the key field lengths match the program'sDspecs. - Search for all programs calling
INV500Rto ensure 'TEST' parts aren't expected to be logged. - Review
INVHSTrecord format to see if the timestamp field is system-generated or requires a program value.
Connects securely to your tools. The creator never sees your data.
About this skill
Legacy IBM i systems often hide critical business logic in decades-old RPG and CL source code. This skill provides the specialized knowledge to parse fixed-format specs, map complex data flows, and perform impact analysis on AS/400 environments.
What it does
- Analyze source code by interpreting fixed-format RPG (H/F/D/I/C/O specs) and CL commands to extract program logic.
- Map dependencies using
as400_source_refsto identify file usage, program calls,/COPYmembers, and data areas. - Describe data layouts via
as400_dds_describefor physical, logical, display, and printer files. - Trace call graphs to determine program relationships, including dynamic calls and
OVRDBFredirections. - Identify anomalies such as dead code, hard-coded values, and missing error handling in legacy members.
How it works
- Discovery: Locate the member and determine its type and last change date using source list filters.
- Static Analysis: Run
as400_source_refsto get a lower-bound baseline of files, tables, and called procedures. - Deep Read: Use
as400_source_readto analyze headers, prototypes, and logic flow in 300-line windows. - Resolution: Link external names to their definitions using
as400_file_descandas400_object_list. - Synthesis: Generate a structured report covering parameters, flow, business rules, and technical risks.
Frameworks & tools
Works with IBM i (AS/400) source types including RPG III, RPG IV (RPGLE), Free-form RPG, and CL. Utilizes MCP tools for DDS description and object metadata.
Why this beats prompting it yourself
Standard LLMs struggle with column-dependent fixed-format RPG and the specific side effects of CL commands like OVRDBF. This skill enforces a systematic heuristic approach that accounts for dynamic calls and stale DDS source members.
Use cases
- Legacy modernization by extracting business rules from undocumented RPG programs.
- Impact analysis to see which programs are affected by a database schema change.
- Debugging interactive apps by mapping DSPF record formats to RPG indicators and
EXFMToperations. - Code audits to find unreachable branches or hard-coded logic in production libraries.
Known limitations
Heuristic static analysis cannot resolve dynamic calls where program names are variables or commands executed via QCMDEXC. DDS source analysis may be inaccurate if the object was recompiled from a different member.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Technical Documentation.
Cannot resolve dynamic calls using variables. DDS analysis may be stale if source doesn't match the compiled object. Static analysis serves as a lower bound for dependencies.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago
- Software
- As400 Basics MCP