as400 source analysis

    1

    Analyze and document IBM i (AS/400) RPG and CL source code, DDS layouts, and program call chains.

    $2

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    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 Number
    • P_QTY (Packed 7,2): Transaction Quantity
    • P_TYPE (Char 1): Transaction Type (A=Add, S=Subtract)

    Files:

    NameAccessKeyPurpose
    INVBALUpdatePART, WHSEWarehouse balance master
    INVHSTOutput-Transaction history log
    PARTMSTInputPARTValidation of part existence

    Main Flow:

    1. Validates P_PART against PARTMST using a CHAIN operation (Line 45).
    2. Performs SETLL and READE on INVBAL to locate the specific part/warehouse record (Lines 52-58).
    3. If found, updates QTYOH based on P_TYPE. Logic uses EVAL with an IF block (Lines 60-72).
    4. Writes a new record to INVHST containing a timestamp and the old/new balance values.
    5. Sets *INLR to 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 KLIST for INVBAL (Line 50).
    • Dead Code: Subroutine *INZSR contains a call to ERR_LOG that is commented out with a * in column 7.

    Next steps:

    1. Check PRODLIB/DDS(INVBAL) to verify the key field lengths match the program's D specs.
    2. Search for all programs calling INV500R to ensure 'TEST' parts aren't expected to be logged.
    3. Review INVHST record 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_refs to identify file usage, program calls, /COPY members, and data areas.
    • Describe data layouts via as400_dds_describe for physical, logical, display, and printer files.
    • Trace call graphs to determine program relationships, including dynamic calls and OVRDBF redirections.
    • Identify anomalies such as dead code, hard-coded values, and missing error handling in legacy members.

    How it works

    1. Discovery: Locate the member and determine its type and last change date using source list filters.
    2. Static Analysis: Run as400_source_refs to get a lower-bound baseline of files, tables, and called procedures.
    3. Deep Read: Use as400_source_read to analyze headers, prototypes, and logic flow in 300-line windows.
    4. Resolution: Link external names to their definitions using as400_file_desc and as400_object_list.
    5. 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 EXFMT operations.
    • 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Permissions

    Read Files
    Listed7 days ago

    What's inside

    Frequently Asked Questions

    Yes, the skill is specifically designed to handle legacy fixed-format RPG (H, F, D, I, C, O specs) where column positioning is critical, as well as modern RPGLE and Free-form RPG.

    This skill works with any AI agent that supports Model Context Protocol (MCP) tools, allowing it to interface directly with your IBM i source libraries and object metadata.

    The skill uses the `as400_source_refs` and call graph tracing tools to identify all program calls, file dependencies, and /COPY members, though it may flag dynamic calls (like QCMDEXC) for manual review.

    Purchase includes the full suite of analysis tools (DDS description, source referencing, and object listing) along with the heuristic logic required to interpret AS/400-specific commands like OVRDBF.

    The skill provides a 'Deep Read' function that analyzes source in 300-line windows, allowing it to process and document large, monolithic members without losing context or hitting token limits.

    New in Technical Documentation