Afunana — the AI legacy system manager
Afunana Developer is the development environment of choice for IBM Z (mainframe) and IBM i (AS/400) programmers.
It brings the best of every world together:
- the green screen: ISPF and the 3270, PDM, SEU and the 5250;
- a modern editor, as in VS Code;
- the AI, as in IBM Bob or Copilot;
- and what those lack: the whole application documented and checked against the source.
For all practical purposes, Afunana Developer on the web is a complete development environment, with nothing to install.
This extension is Afunana inside VS Code, for people who prefer to work only in VS Code.
It is self-sufficient: it needs no other extension and takes nothing from VS Code or from IBM.
No Code for IBM i, no IBM i Development Pack, no Zowe Explorer, no Copilot, and no local compiler.
Afunana covers IBM Z, IBM i, Oracle, Natural, SAP, Delphi, .NET and PowerBuilder: COBOL, PL/I, JCL, CICS, Db2, RPG, CL, PL/SQL, Oracle Forms, Natural, ABAP, Object Pascal, C# and PowerScript.
It runs on your own servers, air-gapped.
A collection is an application or group of programs analyzed together, with its documentation, source snapshot and cross-references.
One product, three pillars
Afunana reads the whole system and builds one model of it. Each organization chooses its emphasis:
- Documentation and chat: every program, file, field and rule explained, each claim citing its source and checked against the code.
- Maintenance, in Afunana Developer: edit, check, compile and debug on the host, with the impact of a change known first.
- Modernization: a migration plan for the whole application, in which people accept, change or reject what Afunana proposes for each layer. New code is generated from the same model, linked line by line to the old, and proven by test cases compared field by field. The Afunana Runtime runs the new application, with versions and rollback.
On IBM Z
- Nothing is installed on the mainframe: data sets, members, jobs and spool go through z/OSMF over HTTPS, as the connection's user.
- COBOL, PL/I, JCL, copybooks and CICS BMS maps are read and documented; a JCL job is documented like a program, with its steps, programs and data sets.
- CICS definitions show which transaction starts which program; a real CICS transaction runs from the browser as a web form, through IBM's Link3270 bridge.
- Db2 tables, keys and package dependencies come from the catalogue; table data is browsed, or asked in plain words, read-only.
- VSAM record layouts come from the copybooks, with a page of records in the data grid.
- The 3270 terminal runs inside, with your own logon and ISPF at 132 columns; a failed job's spool becomes an explanation of the incident.
- Open and save members from the data set tree; Check on the host compiles the editor text, with errors on their lines.
- Change plans are staged in the developer's own qualifier and compiled before the developer executes them. Production is never written.
What Afunana does
| What it does |
Afunana |
| Develops (programmers) |
The data set tree on IBM Z; on IBM i the member tree with your library list, PDM's options and SEU's line commands, and the debugger. The compile check, jobs, spool and the 3270 and 5250 terminals. |
| Documents the whole system (analysts) |
Overview, processes, programs, files and screens, each claim linked to its source line and checked against the code. |
| Cross-reference and field impact |
Calls, file use and every field, from the source and the machine. |
| Relations between tables |
The ERD, a tab inside Tables: relations deduced from the code, each with its source lines. |
| The whole machine |
On IBM i, what each source member calls and uses, followed up and down without AI, with a map of the libraries. |
| Code meanings |
From 88 levels, code tables and the owners' answers. |
| Organize |
A button on COBOL members for the WORKING-STORAGE, LOCAL-STORAGE and LINKAGE sections: 01 at column 8, 3 more for each level, clauses lined up. It changes the editor's text only, until you save. |
| Prepares the change |
A plain-words request becomes a plan written as real code, with what it touches and the risks. |
| AI edit and fix loop |
Edit mode changes the open member; each change is checked that it builds, and corrected until it does. |
| Checks when you ask (QA) |
An automatic reviewer reads a member when you ask for it and each plan before it is executed; RPGUnit tests and coverage runs. Save only saves. |
| Keeps the record (managers) |
Every AI request, save and approval kept; models and rules set by administrators only. |
| Knowledge that stays |
Documents, emails, Jira, Confluence, ServiceNow and SharePoint join the collection; the code stays the truth. |
| On your servers |
Your server, your model gateway, air-gapped. |
Afunana prepares the work; your developer decides.
Nothing reaches the live system until the developer saves it.
What you may know today
What each tool does, and where the same ground is in Afunana.
Each tool is described as its own public documentation describes it, October 2026.
| The tool |
What it does |
In Afunana |
| ISPF and the 3270 |
ISPF browses and edits data sets and members, and submits jobs; job output is read from the spool. |
The 3270 terminal runs inside, with your own logon and ISPF at 132 columns. The data set tree opens members; jobs, spool and job logs sit beside it. |
| PDM (WRKLIBPDM, WRKOBJPDM, WRKMBRPDM) |
Lists libraries, objects and members, with an option typed beside each. Options include 2 edit with SEU, 3 copy, 4 delete, 5 display, 7 rename, 8 description, 14 compile, 15 create module, 25 find string. User-defined options, and F-keys such as F6 create, F17 subset and F21 command line. |
The member tree takes the same option numbers and F-keys, with your library list. Afunana adds its own letters, such as D for the member's documentation. |
| SEU and the 5250 |
SEU edits a member line by line, with line commands in the sequence column. The 5250 screen runs every command and program. |
The editor takes SEU's line commands: C, M, D, R, I, A and B, and their blocks. F3 exits and Ctrl+S opens the save window, as in SEU. The 5250 terminal runs inside; Shift+F9 opens it from the editor. |
| Zowe Explorer |
Works with z/OS data sets, USS files and jobs from VS Code: edit members, submit JCL, read the job output. |
An IBM Z sign-on shows data sets in the same tree. Open and save members; Check on the host compiles the editor text. |
| IBM Z Open Editor |
Language support for COBOL, PL/I, HLASM, REXX and JCL: colours, completion, outline, error checks and rename. |
Colours, completion, go to definition, Find All References, rename across members, outline and call hierarchy. Hover a name for what it means and who uses it. |
| COBOL language extensions |
Colours, completion and error checks for COBOL, with copybooks found. |
Cobol checked as you type: undefined names, unused data, missing PERFORM targets, copybooks not found. Hover a COPY to see the copybook as the program receives it, REPLACING applied. |
| Code for IBM i |
Connects VS Code to an IBM i: browse and edit source members and IFS files, compile, and see the errors in the Problems view. |
The member tree, the editor and Check on the IBM i, with compiler messages in Problems. Jobs, job logs, spooled files and messages one click away. |
| IBM i Development Pack |
A bundle of extensions around Code for IBM i, which IBM supports: language support for RPG, Cobol, CL and SQL, Db2 for IBM i, and project tools. |
Checks as you type for Cobol, RPG, CL, DDS and SQL. A file's real data, browsed or asked in plain words or SQL, read-only. |
| GitHub Copilot |
Suggests code as you type, and answers and edits through a chat in the editor. |
The rest of the line suggested as you type. A chat that answers from the whole system and cites the program and the line; Ctrl+K edits the selection. |
| IBM Bob (Premium Package for i) |
IBM's AI development assistant; the IBM i package adds RPG, CL, SQL and DDS skills: it explains RPG, converts it to free-form, turns DDS into DDL and runs RPGUnit tests. |
The chat explains any program from the documented system. Free-form RPG, DDS to DDL, OPM to ILE and RPGUnit tests are built in. |
Server-side services and your host authority determine which operations are available.
Set up
- Install Afunana from the Marketplace, or install the VSIX supplied by your organization.
- Run Afunana: Login: enter your organization's server address, your user and password, or use Single sign-on.
- Pick a collection on the Dashboard.
- Choose your IBM i sign-on with Afunana: Choose AS/400 Sign-on for the live host tools.
- Open Afunana Developer (Tools › Develop), open Programs, and click a program to open its source.
Contents
- Get started
- Collection documentation
- Program documentation
- File and table documentation
- Screen documentation
- SQL and query documentation
- Command documentation
- Search across the collection
- Manage code
- Run and watch on the IBM i
- Ask Afunana
- Review and approve
Get started
Install and connect
The extension from the Marketplace, and how to connect to your server.
- Tools > Integrations has two tabs: "VS Code extension" and "AI assistants".
- The extension card offers "Install from Marketplace" and "Download the file" (shows .vsix type and size), plus install hints.
- "Connect to your server" lists the steps and shows the server address to copy, with a warning if it is localhost.
- "Afunana: Login" opens a form with Server, User and Password, plus a "Single sign-on" button that finishes in the browser.
- If the account requires it, Login asks for an authenticator or recovery code; on a non-HTTPS server it warns before sending the password.
- "Choose AS/400 Sign-on" picks the IBM i profile your admin assigned; the password is kept in VS Code's secure storage.
- The status bar shows your profile and library, and turns a warning colour if the saved password belongs to another profile.
- The "Get started with Afunana" walkthrough: sign on, open a library, edit, check, save on close, ask the chat.
- AI assistants tab: "Add to VS Code", plus an endpoint to copy for Claude, ChatGPT, Cursor and others (config JSON, "Insert my token").
All your collections
Every analysed collection, with a business summary of the one you pick.
- Greets you by time of day and by name.
- With more than one collection, a "Collections" rail lists them all, each with its platform logo and its own colour.
- A "Filter by name…" box appears above the rail once the list is long.
- Click a collection to switch to it; the page reloads that collection's content.
- The summary card shows the collection's display name and its system summary paragraph.
- Shows "This collection has not been built yet" or "Building now…"; while building, the page refreshes by itself.
- "Quick actions": System Overview, Programs (with count), Tables (with count), Tree.
- "Pick up where you left off": your last program, last file and last chat, each with how long ago.
The Afunana commands
Every action is in the command palette: type Afunana.
- Most commands are in the Command Palette (type Afunana); the rest are on menus and the tree.
- Sign in and setup: Login, Select Collection, Choose / Set / Clear AS/400 sign-on, Check for Updates, Get started, Open Full App.
- Documentation and lookup: program and file documents, object card, Lookup Field, Who uses this name, copybook, file data preview, screen preview, CycloneDX export.
- IBM i members: Open member (Ctrl+Alt+P), Check on the IBM i (Ctrl+Alt+V), Run, Save (Ctrl+S), free-form RPG, terminal (Shift+F9), tree commands.
- Source control: Write to the IBM i, Write all members, Discard changes, Compare with the IBM i copy.
- Line notes: copy a web or VS Code link to a line; add, edit, delete and list notes on lines.
- AI and chat: Edit here (Ctrl+K), Explain this, What does changing this touch, Apply / Discard, Undo plan, Open the chat.
- Debug: Debug this member, Coverage run, Clear the coverage colours.
- AI edit commands and line notes are also on the editor's right-click menu for COBOL, RPGLE, CL, DDS and SQL members.
Help inside the product
A guide for each screen.
- The book icon "How this screen works" opens a manual for the current screen: purpose, numbered screenshot, steps, shortcuts.
- Screen manuals cover the main screens, in the collection's language.
About Afunana
A short tour of what Afunana is for.
- The (i) button in the panel's top bar opens "Afunana — product overview" in a large window.
- The top line shows your licence: valid until a date, trial, development, or expired.
- "View for" picks an audience: Getting started, Enterprise overview, Business users, Developers, AI and risk managers, Complete overview.
- Each audience gets its own ordered set of topics; the "Topic" picker jumps to any of them.
- Each topic shows a title, a lead paragraph and a diagram.
- Previous / Next and the arrow keys move between topics, with your place shown.
- "Return to work" closes it; your page, collection and scroll position stay as they were.
Collection documentation
The collection explained
What the collection is for and why it matters, in business words.
- The header shows the collection's name and "Business overview", with Verification and a Documentation download in the actions menu.
- The top panel shows the system's name and a short introduction.
- "Purpose" tab: why the system exists, one sentence per line.
- "Overview" tab: a side menu of the main processes; each shows Starts when → Started by → Outcome.
- Each process has "The process" (numbered step cards, clickable program badges, "The choice here") and "In detail".
- "Notes" tab: findings grouped by kind under COBOL / RPG / SQL tabs, red or amber by severity.
- Click a finding to see caller and called code side by side, with the cited lines highlighted.
- Notes also lists "Performance suggestions" and "Risks in the design", with the programs as links.
- Thumbs up / down approval of the collection document in the header.
Summary, glossary, each business process and the documents.
- Side menu: Summary, Glossary, Business processes (a folding group, one coloured dot per subsystem), Documents.
- Clicking "Business processes" unfolds the list and opens the first one.
- In the narrow VS Code sidebar the same menu becomes one dropdown above the page.
- The menu and header stay put; only the content scrolls.
- The Verification button follows what is open: that subsystem, the glossary, or the summary.
Business glossary
The collection's own terms, each defined from the code.
- The top line shows the business domain and the number of terms.
- Area pills (All, each business area, "Across the system") filter the terms by subject.
- Terms appear as cards under their area's heading, each with the start of its definition.
- Click a card for the full definition and how the system treats the term.
- "Based on" unfolds the programs and files the term was drawn from.
- An amber banner warns when the glossary is incomplete.
Each business process, step by step
What every step does, the screens the user sees, the files it uses.
- Each business process shows its title in its colour, then a narrative paragraph.
- Two tabs: "Processes" and "Main programs".
- Processes: a side menu of steps; steps that belong to another process are greyed and say which.
- Step tabs: What this step does, Screens the user sees, Reports it prints, Files and tables it uses.
- File cards show the file's name, what it is and how the step uses it (read / write), linking to the file.
- "Show the screen" draws the display file's layout in a window.
- The first step also shows Starts when / Started by / Outcome.
- Main programs: a side menu of programs with short labels, "Shared service" lines and the areas it is "Used by".
Documents for each audience
Requirements for the business, analysis for analysts; add your own.
- A Documents table has one row per audience: Business, Analyst, Programmer, with author and date.
- Click a row to generate or open that document in a large window, and download it as HTML.
- Each row has Download and Regenerate; a stale document regenerates when opened.
- "Generate All" builds the Business and Analyst documents in one go.
- "Add" uploads your own files: PDF, Word, Excel, CSV, text, PowerPoint, email.
- "Uploaded Documents" lists each with its chunk count and upload date; view, download or delete.
Program structure
From the entry command down to every program it calls.
- The header reads "Program structure: Internal flow, direct calls and data dependencies", with a Verification button.
- One button expands or collapses the whole tree; "Search tree…" filters it, × clears.
- Programs carry a type pill (CBL, RPG, CLP); CICS transactions appear as entries.
- An expanded program shows SECTIONS, PARMS, its files, its SQL / query / command members, then the programs it calls.
- Rest the pointer on a name for a short balloon with "Open documentation".
- Click a program to open its documentation in a resizable split panel; its code can open alongside.
- Right-click: Show document, Show code, Data (files), Call flowchart, Referenced by (with a count).
- A fork icon after each program opens its direct call map in one click.
- SECTIONS shows the paragraph and section call tree; click a section to jump to it in the code.
- PARMS lists each parameter with type and length; click one to pin its definition.
- Files show an I / O / IO badge; expand for fields with key icon, type, length and COBOL name.
- Amber glow and "submitted": a program or command run by SBMJOB, shown like a direct call.
- Violet glow and "collection X": a root program of another collection, documented there.
- Circular calls show an amber warning and "Circular" and do not expand further.
Program documentation
Every program
What each program does and why, searchable and tagged by business area.
- Searchable list of every program in the collection, with its name, type pill and a short description.
- The heading shows how many programs match against the total.
- Filter by free text, by an ID box, by a Table box, and by a Type dropdown of the types present.
- Matches are highlighted, and the list scrolls to the first match.
- Coloured business tags above the list: click one to show only that area's programs, or click All.
- Click a row to open that program's documentation page.
- The pencil opens the source; in VS Code the member opens in the editor.
- The relationships icon opens a popup: Directly called by, Direct calls, Tables; each entry is clickable.
- A Retired badge marks retired programs, and a note icon marks programs with notes.
Program summary
Its purpose, business area, who calls it and what it produces.
- The Summary tab opens first: the business purpose as a paragraph.
- A facts table shows Business area, Called by, Produces, and a Criticality badge with the reason.
- A Main operations side menu: pick one capability to read its explanation beside the menu.
- A tab strip holds Summary, What it does, Notes, Suggestions and Info; empty tabs are greyed out.
- The top line shows Back, the path (System overview › Programs), the program name and the open section.
- Approval thumbs in the header: up approves (remark optional), down rejects (reason required).
- The ⋯ menu holds Impact, Verification, Watch, Rebuild documentation, Documentation download, Proof marks and Show code.
- "Documentation" downloads the program's full documentation as one HTML file; in VS Code through the save dialog.
What it does, part by part
A side menu of the program's parts, each explained.
- A side menu of the program's parts, with the chosen part's text beside it.
- The first row, "Its place", says where the program sits and who calls it.
- Other rows use short names such as Who calls it, Start up, Main loop, Keys, Errors, Ending, Data it uses, The screen.
- Line references in the text are green chips: click one to jump to that source line.
- In VS Code a citation opens the real member in the editor at that line.
- On the web the code opens in a split panel beside the document, scrolled to the line and highlighted.
Info and runtime use
Language, author, date written, and how often it really runs, measured daily.
- Program Name, Purpose, Author, Language, Platform, Date Written, Last Modified, Installation.
- Runtime use: "Last used {date} ({n} days ago)", days used, and "Measured daily since {date}".
- Shows the measured object as library / type, beside the runtime figures.
- A strip with one cell per day; hover a cell for used, measured but not used, or not measured.
- A help circle explains that not seen does not mean unused: year-end and recovery programs run rarely.
- With no measurement: "Not measured on this system", with the reason.
Flowcharts, processes, rules, input and output, tables, calls, changes, and more.
- Sections: Summary, Documents, Flowcharts, Processes, Business Rules, Input and Output, Tables, SQL, Commands, Program Calls, Changes.
- Optional sections: API for CICS commarea programs, and Tests built from the rules.
- Sections with no data are greyed out; the open section is remembered per program.
- In the narrow VS Code sidebar the menu becomes a single dropdown.
- Documents: upload files, generate business, analyst or programmer documents, download, regenerate or delete them.
- SQL and Commands list what the program runs; a name click opens the object, the help circle opens its card.
- Verification opens a window with checks, reports and the approval history.
- Select text in a section to quote it in a new report.
Flowchart
The program's main flow, from start to stop, with line numbers.
- A tab strip: Flowchart, Code Flow, Call Hierarchy, Data Flow, and File map.
- The flowchart is drawn from the parsed source, Start to Stop, in standard shapes: decisions, input/output, calls, loops.
- Every box has a green line chip; click it to show that line in the code.
- Click a paragraph or section box to drill into it; a bar shows Back, its name and its line.
- Conditions split into Yes below and No to the right, then rejoin the main line.
- Hover a shortened decision diamond to read the full condition.
- A Parameters box lists the program's entry parameters.
Code flow
Each paragraph and section, explained, with its line number.
- A tree of the program's execution, built from the code, starting at its entry paragraph.
- Each paragraph or section shows the description the documentation wrote for it.
- Colour and icon by kind: PERFORM, CALL with parameters, IF / EVALUATE, loops, GO TO.
- Branch labels read "if true", "else", "WHEN OTHER" or the WHEN value; recursive performs are marked.
- Click a node to open or close it; Expand all and Collapse all.
- The green number chip opens the code at that line.
Call hierarchy
Every program it calls, with what each one is for.
- Left to right: the programs that call this one, this program (ringed), then the programs it calls.
- Each box shows the name, a coloured type tag (COBOL, RPG, CL) and a short description.
- Opens on direct calls; "Classic view: all levels" shows the whole chain.
- Zoom, fit and drag to pan; text never gets too small to read.
- Cycles are drawn as dashed, animated arrows.
Data flow
Each step coloured by what it does with data: read or write.
- Three columns: Input, Processing, Output.
- Inputs and outputs typed by icon and colour (table, screen, parameter, file), with their access mode.
- Hover an input or output to read its description.
- Processing steps are numbered with a badge: Read, Write, Calculate, Validate, Transform, Call or Process.
- Each step's line chip jumps to the source line; arrows show the order.
Processes
The program's own steps, in order.
- The program's processing steps in order, numbered; each opens on click.
- An open step shows its business function and description, one sentence per line.
- Line citations jump to the source; in VS Code they open the editor at that line.
- Chips with section names jump to that section in the code.
Business rules
The rules the code enforces, numbered, in plain words.
- Business rules, numbered; each row's title is the first sentence of the rule.
- An open rule shows the rest, its implementation and its benefit (in green).
- Cited source lines are chips that jump to the code.
- Rules confirmed by an expert show "SME-verified" with who and when.
- A rule laid out as a decision chain gets a "Decision table" button: If columns, Then columns, the lines.
- Field names in the table open the field; line references jump to the source.
Parameters and files in and out, each with its impact.
- Tabs: Parameters, System Input / Feedback, Input Files, Output Files, Return Values; empty tabs are greyed out.
- Parameters: name, a number / text / date tag, length and description.
- System input shows each data item, where it comes from, and its business purpose.
- Input Files: file name, type, key fields and a description.
- Output Files: file name, the operations (add, update, delete), and any "(via …)" note.
- Return Values explains what the program hands back.
Tables it uses
Each file and how the program uses it.
- Every database file the program uses, with an i, o or io badge and its description.
- Open a file for its full field table: names, types, lengths, keys and descriptions.
- "DB Relations" (two or more files) opens a full-screen relationship diagram with search and zoom.
- Relationships are labelled, for example shared key or master-detail; click one for the matching code.
- "At run time" lists the data set each file really opens: job step DD, CICS definition, file override.
Program calls
Who it calls and who calls it.
- Tabs: Calls, Called By, and "Runs when a file changes" for trigger programs.
- Each call is numbered with the called program's name and the first line of its purpose.
- Open a call for its full purpose and a parameters table: name, type, length, description.
- A red "Param error" badge flags calls whose parameters do not match the called program, and says why.
- Called By lists each caller with its business context.
Changes
What changed in the member and when, with developers' notes.
- Tabs: "Changes by date", "Developer's notes", and Releases when Aldon change management is set up.
- The changes table shows Date, Lines and What changed, newest first, from the source's line dates.
- Click a line range to mark those lines in the source and scroll to them.
- Rows can show "Presumed intent" and the developer's note for that change.
- "Explain them (n)" writes explanations for changes that have none yet.
- Developer's notes: date written, who, the note as written, and whether it matched a change.
File and table documentation
Table summary
What the file holds and what goes wrong if its data is wrong.
- The page title reads " Table documentation", with a trail back to System overview and Files.
- The Summary tab shows the table's plain-English description, set out one sentence at a time.
- A Parameters table (name, type, length, description) appears when the file declares parameters.
- A side menu lists only the sections this table actually has: Summary, Structure, Data, Programs, Impact, Relations.
- The Impact tab shows the change impact report prepared at build time for this table.
- The File map tab draws the table's neighbourhood, one or two steps out, with a name filter.
- Approval thumbs sit in the middle of the header, so you can approve or reject the document.
- The ⋯ menu has Verification (check the document against the code) and Watch (a daily note when it changes).
- In the narrow VS Code sidebar, the side menu turns into one dropdown above the page.
Fields
Every field with type and length, and its Impact and Footprint.
- Each field shows its name, a key icon for key fields, a type icon, length (as "9,0") and description.
- Each description shows two lines. Click the row to open the full text underneath it.
- The Impact button on each field opens what a change could break: programs, copybooks, files, callers.
- The Footprint button opens everywhere the field lives: files, programs, copybooks, screens, moves, other collections.
- Click a field name to open its Cross Reference window.
- An ⓘ beside a field shows each value's meaning (e.g. 01 = ACTIVE), with the source program and code.
- A "Personal data" badge marks fields that hold personal data; hovering names the kinds.
- A badge for the field's business group (identity, money and so on) appears after the description when the build supplies one.
- Names are never cut off, even long Oracle names.
The real data
Browse the file's records, or ask in plain words ("employees who left this year") or in SQL (a SELECT, read-only); filter the answer, see the SQL behind it, download it.
- Browse the live rows a page at a time with Top, Back, Next and Bottom; each row shows the machine's real RRN.
- Click a column heading to sort. The screen says "(sorted within these records only)" because only the loaded rows are sorted.
- Every column heading has a "Show the values this field holds" button: counts across the whole file, commonest values first.
- Hover a coded value to see what it means, taken from the program source, with the program and lines.
- Click a row to open "Record" in its own window, one field per line with its description.
- Type a question in plain words and press Ask. The answer replaces the browse until you go "Back to browsing the table".
- To filter, ask: a question becomes one SELECT. Typing SELECT/WITH runs your own SQL (read-only, this table only).
- Use the arrow keys to step back through the questions asked in this visit. They are kept in memory only.
- Numbers you type never reach the AI. Personal columns in answers are hidden: "Personal columns hidden:".
- "Show SQL" reveals the statement that ran and the values bound to it. "Edit and run" puts the SQL back in the box.
- "Download" saves the rows on screen, in the order shown, as CSV named by RRN range or "answer".
- "Explain this page" flags bad dates, undeclared values, empty and full fields. "Values the code doesn't handle".
Who uses the table
Programs with read, write or update, and the SQL and queries that use it.
- Lists every program that uses the table, each with a coloured badge: READ, WRITE or UPDATE.
- Open a program to read its summary in tabs (Business Role, How It Works, Notes).
- A table "SQL, queries and commands that use this file" shows Type, Name, Action and Run by.
- Actions are spelled out in words: "reads", "changes", "reads and changes".
- "Run by" lists the programs that run each SQL member, query or command, as links.
- Commands reach the table through their processing program.
- A "Triggers" table lists the programs the machine runs when the file changes, and when.
- Each program or member name opens its own page.
Relations
How the file relates to other files: logical files and keys.
- Shows the table as an ERD: a box for each table, listing its key fields (# declared, ~ stand-in ID fields).
- Switch the scope between "This table", "Its area" and "All tables".
- Solid lines are a "Declared foreign key" or a "Logical file over a physical file"; dashed lines are "Inferred from programs".
- The legend counts each kind of relation. Large diagrams say "Showing N of M tables".
- Hover a line to see, for example, "A is a logical file over B", with the joined fields.
- Click a line to pin its evidence: why, "Joined on" fields, the constraint name and the programs (as links).
- Click a table box to open that table. Hover it to see the table's meaning.
- Tables with no declared key say "no declared key, N fields".
Screen documentation
Screen documentation
What the user does on the screen and where it leads.
- The title reads " Screen documentation", with a trail back to the Screens list.
- The Description tab has sub-tabs: Description, Programs and File map.
- Description shows the screen's plain-English explanation, one sentence at a time.
- A Structure tab lists the display file's fields with type, length, description, Impact and Footprint.
- A Screen tab draws the screen as the user sees it, taken from the DDS source.
- Header approval thumbs, Verification and Watch work the same way as on a table.
The screen as the user sees it, and changing it
Drawn from the DDS, with the source under it. Change the screen right here: edit its DDS with the screen drawn live beside it (Show the screen beside), then Save sends it to the IBM i.
- Draws the 5250 screen in green on black at real size, with colours, highlight, reverse and underline from the DDS.
- A "View" dropdown switches between "As shown" combinations and single record formats. System-placed windows are noted.
- Fields that depend on indicators get a dashed amber outline. "Indicators (N)" lets you switch indicators on or off to see the result.
- The function key line shows "F3=Exit" and the like, plus "F1–F24 enabled", with help naming the deciding programs.
- Click or hover a field to open its card: type, usage, what you can type, conditions, where it's stored, line.
- The field card also shows "Comes from", business rules, how the program checks it, and the field's path.
- The source is shown beside the screen. Click a line or a field to highlight the other.
- "Edit the source": drag to move, drag the edge to resize, right-click to add text or fields, copy, delete, change keywords.
- Edit tools: Undo, "Undo all changes", "Changes" (a diff), then "Save" or "Save and compile" into your development library.
- In VS Code, "Afunana: Show the screen beside (live preview)" redraws as you type; click a field to jump to its line.
Who uses the screen
The programs that show it, and what they do with it.
- The Programs sub-tab lists every program that opens the screen, each with its access mode badge.
- Open a program to read its summary in tabs (Business Role, How It Works, Notes).
- Each program name links to its own documentation page.
- SQL members, queries and commands that use the screen file are listed with who runs them.
- The File map sub-tab draws the screen's links to programs and files, one or two steps out.
- The function-key help names the programs that decide what each key does.
- On a field card, "Also used in" lists the other programs and files that use that field.
SQL and query documentation
SQL members explained
What the script does, before and after it runs, and what can go wrong.
- The "SQL / Query" list shows every SQL member, Query/400 query and QM query, each with a kind badge.
- Search the list by name, type or description. The list shows how many match out of the total.
- A member's page opens on Description: what the SQL does, in plain English, one sentence at a time.
- The "Tables In Use" tab lists each table with an access badge (SELECT, INSERT, UPDATE, DELETE) and a note.
- Click a table to open its documentation page.
- "Related Programs" lists the programs connected to the member and explains how each one relates.
- Approval thumbs and Verification sit in the header.
The SQL itself
The statements, with what they do.
- The "SQL code" tab shows one black page: an explanation of each statement on top, the SQL underneath.
- Each statement shows its operation badge, its target table and a line reference such as "(12-15)".
- Click a line reference to scroll the SQL to that statement.
- The SQL appears in a terminal-style code view with line numbers.
- For a Query/400 query or QM query, this tab is the query's SQL translation.
Query/400 and QM queries
Each query explained, with the report it feeds.
- A Query/400 query gets a "Query/400" item that copies the WRKQRY screens in 5250 colours.
- The "Define the Query" menu shows the query, library and text, and marks ">" beside each option the query defines.
- Click an option to open its screen. Its Opt field shows "1", as on the AS/400.
- Specify file selections: file, library, member, format, file IDs and join tests.
- Define result fields: each field and its expression.
- Select and sequence fields: every field, with chosen ones first and their sequence numbers.
- Select records: the AND/OR, field, test and value lines. Select sort fields: priority and A/D.
- QM queries have no green screens: you get the description, the SQL code and the tables in use.
Command documentation
Commands
What the command is for and which program it runs.
- The Commands page lists the collection's own commands with a "Command" badge and description.
- Search commands by name, type or description. The list shows how many match out of the total.
- A command's page has Description, Parameters, Who runs it and Source in its side menu.
- Parameters table: parameter, prompt, "required" mark, type and length, default, allowed values ("only these"), and meaning.
- Parameter details come from the command's own source, not from AI.
- Source opens the command's code beside the document, with search and a terminal or light theme.
- Approval thumbs and Verification sit in the header.
Who runs a command
Its processing program and who calls it.
- "Who runs it" names the processing program that runs when the command is called, as a link.
- A table lists each program that runs the command, the line number, and "The command as written".
- An entry command says the operator runs it from a menu or command line, not a program.
- Each program name opens its card or documentation page.
- A table's Programs tab lists commands that touch the table through their processing program.
Search across the collection
Every file in one list
Fields and programs per file, searchable.
- Explore > Files lists every file of the collection, most used first.
- The header shows the total, e.g. "1,234 files", plus a Verification button.
- Columns: Name, Fields (shared fields it carries), Programs (using it), Description.
- The search box searches every kind at once: program, file, field, SQL, query, command, screen.
- Click a result to open its object card beside the list, with "Show on the map".
- Click a file row to centre the map on it: its fields on one side, its programs on the other.
- Click any box on the map to re-centre on it; the trail and Back retrace your steps.
Every field
Each field with how many files and programs use it.
- Explore > Fields lists every field, including fields defined in only one file.
- Columns: Files (defining it), Programs (touching it), Read, Write, Description with type and length.
- "Only fields defined differently in different files" shows the conflicting fields and their count.
- Click a field for a map of its files and programs; each file shows its declaration, the odd one flagged.
- "Per-file definitions" shows a key badge and "declared differently" marks.
- An "Impact" button opens the field's blast radius.
- VS Code's "Afunana: Lookup Field" opens this list with the field already searched.
Call flow map
Who calls whom, from the entry points down; click to follow.
- Explore > Maps > "Call flow": where execution begins, what each program calls, where a change may spread.
- Fact tiles: Entry points, Shared services, End points, Most connected.
- The diagram shows the most connected programs: amber entry points, violet shared services, arrows for direction.
- Each box shows "entry point", "shared · N callers" or "N tables", plus "calls N".
- "Find a program…" picks one; zoom, fit and drag to pan.
- Select a box to highlight its neighbourhood; a side panel shows its role, "Why it matters", callers, calls and tables.
- The panel ends with "What to inspect next" and "Open full program details".
File use
Programs against files: read, write, update, delete; download as CSV.
- Explore > Maps > "File use": which programs create, read, update or delete each file.
- Two tabs: Programs > Files, or Files > Programs.
- Filters "Program contains" and "File contains", plus "Include screens and reports".
- Read, Write, Update and Delete columns marked X; "?" means the use was not recorded.
- Hover a cell for program → file, how it is used, and the extraction code.
- "Download CSV" exports everything.
- A note counts uses of files named only at run time, which cannot be shown.
Manage code
Develop: open the programs list
Your IBM i libraries beside the analysed collection; open Programs to list every program of the collection.
- Tools > Develop shows the "IBM i and collection" tree; a copy of it can also sit in the VS Code sidebar.
- Libraries expand into source files, then members; a z/OS sign-on shows data sets instead.
- "Collection {name}" lists the collection's Programs, Files and Screens; a click opens the source.
- Clicking a library member opens it in VS Code's editor, checked out; it saves back on close.
- Title actions: Open IBM i member or program, Search the tree, Clear the search, Add a library, Refresh.
- Search shows names starting with your text, or matching a * pattern.
- "Add a library" takes a name or a * pattern; right-click a library to remove it from the tree.
- "New member" on a source file asks for Member, Source type (the file's usual type) and Text (50 characters).
- A grey dot marks a member open in a tab; a green dot marks one with unsaved edits.
- Ctrl+Alt+P quick open: recent members first, then library members, then collection programs and files; LIB/FILE(MEMBER) opens one directly.
Going to the source
Click a program in the list: its source opens under its IBM i name (library › source file › member), with COBOL colours and who performs each section.
- Syntax colours for COBOL, RPG / RPGLE, CL, DDS, SQL and PL/SQL; COBOL colours divisions, sections, paragraphs, levels, PIC clauses, copybooks and comments apart.
- COBOL gets column rulers at the sequence area, the indicator column, the Area A/B boundary and column 72.
- COBOL is checked as you type: undefined names, unused data, missing PERFORM / GO TO targets, copybooks not found, duplicate paragraphs.
- RPG checks: unknown opcodes, unbalanced blocks, missing EXSR / GOTO targets, copybooks not found, undefined names.
- CL checks: unknown commands, wrong keywords, undeclared and unused variables, PGM / ENDPGM, MONMSG.
- DDS checks: invalid columns, duplicate formats, unknown or invalid keywords; SQL checks: unbalanced blocks or brackets, unknown types, columns not found, missing INTO.
- Quality findings in Problems on open and on save: moves that cut the value (with the bytes lost), CALL parameters that do not match.
- Performance suggestions (INITIALIZE / SQL / OPEN inside loops, SELECT *) with the quick fix "Apply the Afunana rewrite", shown as a diff.
- Other quick fixes: Define the name in WORKING-STORAGE, Declare &VAR, Create the paragraph, Remove an unused definition.
- Hover on a CALL: the program's purpose, language, line count and criticality, with Open doc and Edit source.
- Hover on a file: what it is, its use in this program, open mode, organization, access and record key, with Preview data.
- Hover on a field: its meaning, 88-level values, record or copybook layout, and who writes, reads or calls it.
- Hover on a COPY: the copybook as this program receives it, with REPLACING applied; click for the full panel.
- The copybook panel lists fields with types and 88 values, nested copybooks, and marks the lines REPLACING changed.
- CodeLens above the header and each paragraph: "called by N", "performed by N", "reads X", "writes Y", "N suggestions".
- CodeLens above each CALL names the called program and its purpose; click for its documentation.
- F12 / Ctrl+click jumps to paragraphs, copybooks and called programs; also Find All References, rename across members, outline, call hierarchy.
- "Show the card for the name under the cursor" opens the object card beside the code; a field's card lists where it is used.
- Completion offers data names, paragraphs, copybook fields with PIC, keywords and snippets per language.
- Select code, then Ctrl+K "Edit here", "Explain this" or "What does changing this touch"; the proposed edit is a diff with Apply / Discard.
- "Fix with Afunana" on any problem; it compiles on the IBM i, and when that fails it fixes the code and tries again.
- Ghost text: the rest of the line suggested as you type.
- "Convert to free-form RPG" opens a diff and a report; "Put it in and check on the IBM i" applies and compiles.
- Display and printer files get a live screen preview beside the code; click a field to select its DDS line.
- While you edit a field or record format, a CodeLens says who uses it: programs, screens and queries.
- Hover a file for its first rows, a field for its most common values.
- On open you are warned if someone else has the member open or locked on the IBM i.
- The cursor line shows its last change (date, author, plan) at the end of the line.
- Ctrl+Alt+V "Check on the IBM i" compiles in QTEMP with no object made; compiler messages go to Problems.
- "Check this member now" re-runs the checks and shows the error and finding counts in the status bar.
- "Run this member": compile into your development library, copy test records, enter parameters, see spool, job log and changed rows.
- "Debug this member": STRDBG in your own job, breakpoints, stepping, variables with their DDS text and 88 names.
- A coverage run colours lines hit and missed, with paragraph and decision percentages and documented rules never run.
- Unit tests in the Test Explorer, grouped by business rule: run one, run all, run on save; a failure shows expected against actual.
- Line notes: a gutter mark shows the note on hover; add, edit, delete or list notes; copy a web or VS Code link to the line.
- Ctrl+S opens the SEU-style Exit window: Change / create member, Member, File, Library, Text; "Replace?" if the member exists.
- Source Control "IBM i members" lists the edits still to be written to the IBM i, with Write, Write all, Discard and Compare.
- Status bar: your sign-on PROFILE / DEVLIB, the system and collection, and the program with a criticality dot.
- In the margin: an R mark on business-rule lines, dead paragraphs dimmed and struck through.
- The tab and breadcrumb show the IBM i path (ibmi:/LIB/FILE/MEMBER); Shift+F9 opens the 5250 terminal.
Source members
Browse any library and source file on the IBM i.
- The System view picks a View: Libraries, Objects, Source members, File data, Structure.
- Fill in Library, File, Object / Member name (a filter) and an Object type such as *FILE, *PGM, *SRVPGM or *DTAARA, then Browse.
- Row actions: Open library, Members (source files), Data and Structure (PF / LF), Structure (DSPF / PRTF), Definition (queries).
- "Open source" shows the member with sequence numbers, its last-changed date, Edit and Download.
- Compile with a library list you choose; the listing appears in place, with "Explain this output with AI".
- Filter the rows, see the row count, Export CSV, and go Back through your steps.
- Your last place, searches and library list are remembered per sign-on.
Compare sources
Two members side by side, or two whole source files.
- "Compare members", two members: type the base library, source file and member; the other side copies as you type.
- Leave the member empty on both sides to compare whole source files, member by member.
- The file comparison marks each member Only on the left, Only on the right, Identical or Different.
- Filters: Changes, All members, Different only, On one side only.
- "Copy to the right / left" copies a whole member, into your development library only.
- The result counts added and removed lines, or says "The source text is identical."
- The side-by-side diff lets you copy single changes into your development-library member, then save or compile.
- "Explain changes" writes "What changed for the business"; "Download HTML" saves the comparison.
Conventions
How this collection writes its code, measured from its own members.
- Tools > Conventions: how this collection writes its code, measured by the build from its own members.
- A side menu: Names, COBOL, Copybooks, the collection's own way (snippets), CL, Physical files, Display files, examples.
- Names: the system prefix and each kind's pattern, e.g. COBOL programs ENK + subject + role, 8-10 characters (10 of 10).
- Pairs it found: a screen program and its display file, a file and its copybook, a CL program and its COBOL program.
- Every rule is a count over the collection's own code, with the member names as links.
- Plans and new members follow these conventions first.
Run and watch on the IBM i
Jobs
Your jobs: running, queued, completed, waiting for a message, scheduled.
- Tabs: All jobs, Running, Queued, Completed, Message wait, Scheduled.
- Period: Past hour, Past 4 hours, Today, This week, All time; choose the user profile.
- Nothing loads until you press Refresh; a search box filters the list.
- Columns: job name, number, status, completion or scheduled time, entered time, job queue; click a heading to sort.
- A dot per job: red for message wait or abnormal end, amber for queued, green otherwise.
- Click a job for Status, Definition and Run attributes, Call stack, Library list, Open files, File overrides.
- The job window adds the Job log, with Refresh, Download and AI analysis.
A job opened
Its status, definition and run attributes, call stack, library list and open files.
- Click a job in the list to open it in its own window, which you can move, resize or maximize.
- Tabs: Status attributes, Definition attributes, Run attributes, Call stack, Library list, and more.
- Status shows the job, user, number, status (here OUTQ), type and when it was submitted.
- The window's buttons: AI analysis, Refresh and Download.
- A job log tab is added when the job has one.
Output
Spooled files, compilations, job logs and messages.
- Filters: All spooled files, Compilations, Job logs, Messages; "Group by job"; search.
- Each spool row shows the job, file name, number and an outcome or severity mark.
- Open a spool file to read it, refresh it or download it.
- Messages show severity, message ID and text, including the second-level text.
- "Explain this output with AI": a summary, findings with next steps, the evidence, and what remains uncertain.
Job commands
Work with a job (WRKJOB and the rest) without the green screen.
- Job commands without the green screen: WRKJOB, WRKUSRJOB, WRKACTJOB, WRKJOBQ, WRKOUTQ, WRKSPLF.
- Object commands: WRKOBJ, DSPOBJD, DSPFD, DSPFFD.
- WRKACTJOB has a System Status tab: CPU %, jobs in the system, ASP use and the pool table.
- WRKUSRJOB asks for User, Status (*ALL / *ACTIVE / *JOBQ / *OUTQ) and Job type.
- Results can be filtered and drilled into, with Back; spool files open with AI analysis.
- DSPOBJD, DSPFD and DSPFFD open their own description and field windows.
5250 terminal
The green screen itself, inside VS Code, always dark like the console: Command Entry, F-keys along the bottom, Shift+F9 from anywhere.
- A real 5250 screen in a window, drawn from the host's own rows, colours and fields; dark like the console.
- Enter, F1–F24 (Shift+F1–F12 = F13–F24), Page Up / Down and the arrows go to the host; the mouse wheel pages.
- Shift+F9 opens it from anywhere, the editor included; × hides it and keeps the session.
- Click the screen's own key legend ("F3=Exit") to press that key.
- Choose 24×80 or 27×132, and the dark or light palette.
- Signs on by itself with your IBM i sign-on; Reconnect when the display has closed.
- Program, file, field and paragraph names on screen (SEU, WRKMBRPDM) underline and open the object card.
Messages: the system operator's messages
The QSYSOPR queue, read-only, under your own sign-on: newest first, by severity, with an inquiry that waits for a reply marked. Each message has an AI explanation: what happened, why, and what to do.
- Reads QSYSOPR, read-only, under your own sign-on, loaded on Show / Refresh.
- Filters: Period, Severity (Any, 20+, 40+, 60+), Type (Inquiry, Informational, Escape…), Job, Text.
- "Waiting for a reply only"; the page says how many messages are waiting.
- Severity chips coloured severe / error / warning / info; open a message for its second-level text.
- An inquiry shows "Waiting for a reply" and how to answer on the host; Afunana never replies itself.
- The job opens the job window; a program of the collection links to its card.
- "Explain": What happened, Likely cause, What to do and Where, with links.
- "Watch: explain new errors" reads the queue again every few seconds and explains new errors by itself.
Watched
The programs and files you follow, in one window. Afunana tells you when one of them changes: its source changed, it is new or gone, it was recompiled, or the object itself changed on the IBM i.
- "Watch" a program or file: only it, it and everything it calls, or the whole library.
- The Watched list: Object, Kind, Scope, Collection, Last change, Since, with Unwatch.
- Filter by collection and by kind (program, file, copybook, library, source file).
- What raises a note: source changed, new, removed, recompiled, object changed.
- Changes are found by the build scan and gathered once a day into Messages; email at most once a day.
Where you hear about it
The news about what you watch arrives under your name at the top of the screen, with a red badge until you read it.
- A Messages button in the top bar, with a red badge counting unread items.
- Two lists: contact-form messages (administrators) and "Changes you follow".
- Each change shows the object (a link), what changed, the collection and the day.
- Unread dots mark new lines; opening the window marks them read.
Ask Afunana
Ask, or ask for a change plan
A plan lists every member to edit and recompile, each with Diff and Apply.
- Answers carry (PROGRAM:LINE) citations that open the code at that line.
- Ask about the open member, or the lines you select.
- The chat reads the live host as you, with your own authority: any library, job log or spooled output, not only what is documented.
- A command comes back as a card; it runs only when you press Run.
- Edit mode changes the open member; accept or reject each change.
- Each change is checked that it builds, and corrected until it does.
- Program, file and copybook names in answers and tables link to the object card.
- Diagrams and tables are drawn in the answer; tables download as CSV.
- Answers stream a sentence at a time with a stage label, and show their time and time to first word.
- "Open it" buttons for the terminal or a page above the answer.
- Thumbs up / down with a category and details; a Verification button turns green, amber or red.
- Type @ to mention programs, files, fields, copybooks, SQL, queries and commands; attach images or text files.
- A plan card lists steps (edit, compile, file change, verify, create member), recompile order, regression tests and open questions.
- In VS Code each plan member has Diff (compiler messages in Problems) and Apply (into the editor).
- Execute writes the checked members to your development library and compiles; "Download change dossier" and Undo plan.
Plan or Ask
Choose how the chat answers.
- The mode pill is the mode menu: Plan and Ask.
- Ask: "Ask questions without changing code".
- Plan: "Plan and design before coding"; the answer is a change plan card.
- The chosen mode stays until you switch back.
- Plan on a program's page starts with "Plan a change to {name}: ".
Review and approve
1. The thumbs on the document
At the top of the collection overview, of each program and file document, of each SQL member and query, and on a change plan in the chat: thumbs up = OK, thumbs down = not OK.
- The same two thumbs as answer feedback decide an approval: up approves, down rejects.
- On a program, file or collection document, and on a change plan card.
- Tooltips say "Approve / Reject this document" or "Approve / Reject this change".
- Only people with permission see the thumbs; everyone sees the state.
- Nobody approves their own change.
2. Write the approval
Thumbs up opens the small form: a remark if you have one, then Approve. Thumbs down asks for the reason.
- Approve opens a small form with an optional remark; with a remark it is recorded "Approved with a remark".
- Reject requires a remark: "Why is it rejected? (required)", and offers a category.
- Document categories: Not correct, Incomplete, Wrong source, Wrong language, Too technical, Other.
- Change categories add Breaks something else, Wrong library or file, Not by the coding rules, No tests.
- Your decision can be viewed later, edited, or withdrawn.
- Each decision is recorded against the exact version of the document or plan.
3. The thumb turns green
Approved: the thumb is green and shows who approved it and when. A changed document asks for approval again.
- An approved thumb turns green; the chip reads "Approved · name · date".
- Other states: Approved with a remark, Changed since approved, Waiting for approval, Rejected with reason, Not approved yet.
- "Changed since approved" appears when the document or plan changed after the approval.
- Click the chip for who, when, which version, why, and the automatic reviewer's verdict.
- The chip window lists the full decision history.
Settings
| Setting |
Default |
What it does |
afunana.serverUrl |
https://afunana.io/api |
Your organization's Afunana server. Afunana: Login sets it. |
afunana.authToken |
empty |
Your sign-in token, set by Afunana: Login. |
afunana.hoverPopups |
on |
The balloon when the pointer rests on a program, file, field or section name. |
afunana.codeLens |
on |
The lines above the program header and each paragraph: who calls it, what it reads and writes. |
afunana.showIbmiTree |
off |
Also show the IBM i and collection tree at the bottom of the side bar. The same tree is in the Afunana panel under Tools › Develop. |
Requirements and availability
- VS Code 1.85 or later. Extension-provided MCP registration requires 1.101 or later.
- Access to an Afunana server and an analyzed collection for documentation and collection-based intelligence.
- An assigned IBM i or z/OS connection, personal sign-on, and appropriate authority for live resource operations.
- Server-side checking and AI services configured for the features you use.
Features and data depend on your role, server configuration, supported language, and available analysis. Afunana supports localized documentation and application screens.
Learn more at afunana.io.
| |