<?xml version="1.0" encoding="UTF-8"?>
<!--
  MAGEC RAD - Insertion Points Reference
  Source: https://magec.com/DOC/insert_main.htm  (primary)
          https://magec.com/DOC/cstm_main.htm    (TSKLST exhibits, default/custom/proforma explanation)
          https://magec.com/DOC/masteridx.htm    (cross-references to diags, genmmp, cstm anchors)
          https://magec.com/DOC/diags_main.htm   (processing diagrams — anchor key below)
  Generated for AI-assistant consumption.  Last source update: May 17 2026.

  DIAGS ANCHOR KEY (from master index cross-reference pattern):
    diags002000 = SEE  (inquiry/display)
    diags003000 = LOC  (locate / browse mainline)
    diags004000 = CHG  (change — read phase)
    diags005000 = SCN/FND (scan/find browse variants)
    diags006000 = DEL  (delete — display phase)
    diags007000 = DEL  (delete — confirm/execute phase)
    diags008000 = ADD  (add)
    diags009000 = CHG  (change — update phase)
    diags010000 = DUP  (duplicate)
    diags011000 = ADD  (add — post-edit/write phase)
    diags012000 = MBP  (batch — browse/maintain)
    diags013000 = MBP  (batch — report)

  FUNCTION CODES fired by standard MMP:
    SEE  — inquiry (display record, no update)
    CHG  — change  (read-for-update, edit, write)
    ADD  — add     (blank screen, edit, write)
    DEL  — delete  (display for confirm, then delete)
    DUP  — duplicate (copy existing record for add)
    LOC  — locate  (position browse list)
    SCN  — scan    (browse forward/backward)
    FND  — find    (scan with search criteria)
    INQ  — same as SEE in some contexts
    MBP  — batch program (MBP, not online MMP)

  NOTES ON XML STRUCTURE:
    <fires_for> lists which function types cause this insertion point to execute.
    <cobol_paragraph> is the generated paragraph name in which the %POINT appears.
    <section> is the logical grouping from the TSKLST screen.
    <purpose> is a concise functional description.
    <notes> contains caveats, tips, or cross-references.
    <doc_refs> lists authoritative anchors in the live documentation.
    aiMAGEC infers: marks any inference not directly stated in the fetched source.
-->

<magec_insertion_points
  version="2.6+"
  program_type="MMP"
  source_url="https://magec.com/DOC/insert_main.htm"
  generated="2026-06-02">

  <!-- ═══════════════════════════════════════════════
       SECTION A — DATA DIVISION
       Insertion points that place code into the
       WORKING-STORAGE or LINKAGE SECTION of the MMP.
       Code here is NOT procedural — it is data definitions.
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%REMARKS">
    <section>A - Data Division</section>
    <tsklst_label>Program Remarks / Identification</tsklst_label>
    <cobol_paragraph>IDENTIFICATION DIVISION comments area</cobol_paragraph>
    <fires_for>ALL</fires_for>
    <purpose>
      Place COBOL comment lines (remarks) at the top of the generated program,
      typically used for program identification, author, date, or change history.
    </purpose>
    <notes>
      Appears in every generated MMP and MBP regardless of function type.
      Code placed here must use COBOL comment syntax (asterisk in column 7).
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001035">Insertion Points Reference — %REMARKS (online)</ref>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001064">Insertion Points Reference — %REMARKS (batch)</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%DATADEF">
    <section>A - Data Division</section>
    <tsklst_label>Data Definitions (DB-DATA-AREA additions)</tsklst_label>
    <cobol_paragraph>Within TWA-DB-DATA area (LINKAGE SECTION)</cobol_paragraph>
    <fires_for>ALL</fires_for>
    <purpose>
      Add supplemental COBOL data definitions into the DB-DATA-AREA of the TWA
      (Task Work Area). Used to define additional data elements that the MMP needs
      to access beyond what MAGEC auto-generates — e.g. extra copybooks, additional
      Element areas, or host variable areas for SQL. Code placed here participates
      in the pseudo-conversational save/restore because it is in the TWA (LINKAGE SECTION).
    </purpose>
    <notes>
      Data defined here IS saved and restored between pseudo-conversational cycles.
      Use %VARSTOR for fields that need only last within one task invocation.
      Use %LITERAL for constants (WORKING-STORAGE).
      Distinguished from %VARSTOR: %DATADEF is for data that must survive
      across screen sends (TWA-resident), %VARSTOR is for intra-task work areas.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001006">Insertion Points Reference — %DATADEF (online)</ref>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001051">Insertion Points Reference — %DATADEF (batch DB-DATA-AREA)</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm025002">Customization Tutorial — %DATADEF usage</ref>
      <ref url="https://magec.com/DOC/app_main.htm#app008001">Application Developer Tutorial — %DATADEF</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%VARSTOR">
    <section>A - Data Division</section>
    <tsklst_label>Variable Storage (LINKAGE SECTION work fields)</tsklst_label>
    <cobol_paragraph>VARIABLE-STORAGE area within LINKAGE SECTION</cobol_paragraph>
    <fires_for>ALL</fires_for>
    <purpose>
      Add COBOL data definitions for work fields (variables) used within the MMP's
      procedure division logic. This is the LINKAGE SECTION VARIABLE-STORAGE area.
      Preferred over WORKING-STORAGE for variables in mainframe/CICS environments
      to ensure reentrancy.
    </purpose>
    <notes>
      RULE: In mainframe CICS environments, ALL variables (fields you MOVE TO) must
      go in %VARSTOR (LINKAGE SECTION), never in %LITERAL (WORKING-STORAGE).
      Violation causes unpredictable results in WESTI; in CICS it causes inefficiency.
      %VARSTOR data is initialized to LOW-VALUES on every task invocation (not saved
      across pseudo-conversational cycles). Use %DATADEF for data that must persist
      across screen sends. VALUE clause is ILLEGAL in LINKAGE SECTION — do not use it.
      PC/LAN environments have no penalty for using WORKING-STORAGE for variables.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001046">Insertion Points Reference — %VARSTOR</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm002003">Customization Tutorial — %VARSTOR rules</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm002009">Customization Tutorial — %VARSTOR additional notes</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%LITERAL">
    <section>A - Data Division</section>
    <tsklst_label>Data Constants (WORKING-STORAGE)</tsklst_label>
    <cobol_paragraph>WORKING-STORAGE SECTION</cobol_paragraph>
    <fires_for>ALL</fires_for>
    <purpose>
      Add COBOL data definitions for constants and literals into WORKING-STORAGE.
      These are items whose values do not change at runtime (VALUE clauses are valid here).
    </purpose>
    <notes>
      RULE: Use %LITERAL ONLY for constants and literals — never for variables
      (fields you will MOVE TO). In mainframe environments, placing variables here
      causes reentrancy problems. If the program is swapped from memory, WORKING-STORAGE
      data reverts to initialized values — another reason not to use it for runtime variables.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001019">Insertion Points Reference — %LITERAL (online)</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %LITERAL</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm025002">Customization Tutorial — %LITERAL usage context</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%SCHEMA">
    <section>A - Data Division</section>
    <tsklst_label>Special SECTION-NAME (e.g. for IDMS)</tsklst_label>
    <cobol_paragraph>Before PROCEDURE DIVISION — special section name area</cobol_paragraph>
    <fires_for>ALL</fires_for>
    <purpose>
      Insert a special COBOL section name required by some database systems (e.g. IDMS)
      that need a named schema section before the PROCEDURE DIVISION. Rarely used in
      standard VSAM/CICS environments.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001036">Insertion Points Reference — %SCHEMA</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%USRAREA">
    <section>A - Data Division</section>
    <tsklst_label>User Work Area definition</tsklst_label>
    <cobol_paragraph>TWA user work area (LINKAGE SECTION)</cobol_paragraph>
    <fires_for>ALL</fires_for>
    <purpose>
      Define a user-controlled work area within the TWA. Data here is saved and restored
      across pseudo-conversational cycles (because it is TWA-resident / LINKAGE SECTION).
      Used when you need persistent work data not in the standard DB-DATA-AREA.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001045">Insertion Points Reference — %USRAREA</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm013002">Customization Tutorial — %USRAREA</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%FUNCT">
    <section>A - Data Division / Function Code Control</section>
    <tsklst_label>Add/Modify Function Codes</tsklst_label>
    <cobol_paragraph>AA100-CHECK-FUNCTION area</cobol_paragraph>
    <fires_for>ALL — at function-code check time</fires_for>
    <purpose>
      Add or modify the set of Function Codes the MMP recognizes and routes to.
      Allows custom function codes beyond the standard nine (SEE, CHG, ADD, DEL, DUP,
      LOC, SCN, FND, RPT). Code here participates in function-code routing logic.
    </purpose>
    <notes>
      Related to &amp;PFX substitution parameter. See %LOCINIT for browse-specific
      function routing. For adding a completely new function, also code %PREINIT
      and the relevant action insertion points.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001011">Insertion Points Reference — %FUNCT</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm007004">Customization Tutorial — %FUNCT (adding custom functions)</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm007002">Customization Tutorial — %FUNCT and &amp;PFX</ref>
      <ref url="https://magec.com/DOC/sec_main.htm#sec010006">Security Reference — %FUNCT</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION B — INITIALIZATION
       Fires early in program execution, before screen
       display or database I/O for the current cycle.
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%PREINIT">
    <section>B - Initialization</section>
    <tsklst_label>Pre Initialization Routine</tsklst_label>
    <cobol_paragraph>AA000-BEGIN (before any other initialization)</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC SCN FND MBP-BROWSE MBP-MAINT</fires_for>
    <purpose>
      Fires at the very start of the MMP's execution cycle, BEFORE %INIT, %INITATB,
      and %LOCINIT. Provides the earliest possible hook into program logic.
      Useful for: intercepting and rerouting control before MAGEC initializes;
      setting control variables that influence subsequent initialization;
      checking TWA flags set by a prior program before this MMP initializes;
      implementing early exits or transfers to other programs.
    </purpose>
    <notes>
      Because it fires before %INIT and %INITATB, data in screen fields and
      TWA work areas has not yet been initialized for the current cycle.
      Use with care — no MAGEC standard initialization has run yet at this point.
      Default code is provided; if no custom code is entered, default code runs.
      Fires across ALL function types including both online (MMP) and batch (MBP) flows.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001029">Insertion Points Reference — %PREINIT (online)</ref>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001063">Insertion Points Reference — %PREINIT (batch)</ref>
      <ref url="https://magec.com/DOC/genmmp_main.htm#genmmp004032">Analysis of Generated MMP — %PREINIT position</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE flow</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC flow</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG flow</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL flow</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD flow</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP flow</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP flow</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029004">Customization Tutorial — %PREINIT in TSKLST</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%INIT">
    <section>B - Initialization</section>
    <tsklst_label>Maint. Function Initialization</tsklst_label>
    <cobol_paragraph>AA000-BEGIN (maintenance function initialization block)</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP</fires_for>
    <purpose>
      Fires during the initialization phase for maintenance-type functions (SEE, CHG,
      ADD, DEL, DUP). Used to set up work fields, move initial values, or perform
      checks that apply specifically to maintenance operations at the start of a cycle.
    </purpose>
    <notes>
      Fires AFTER %PREINIT but before screen blanking (%BLNKSCR) and attribute
      initialization (%INITATB). Does NOT fire for browse functions (LOC, SCN, FND)
      — use %LOCINIT for browse initialization.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001016">Insertion Points Reference — %INIT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%INITATB">
    <section>B - Initialization</section>
    <tsklst_label>Attribute Initialization</tsklst_label>
    <cobol_paragraph>BA200-INIT-ATTRIBUTES</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC SCN FND</fires_for>
    <purpose>
      Initialize or override screen field attributes (color, protection, intensity)
      at the start of each pseudo-conversational cycle. Fires after %INIT and before
      screen blanking. Commonly used to set dynamic attribute values that depend on
      data content or user authorization level.
    </purpose>
    <notes>
      Attribute bytes control whether fields are protected, unprotected, bright, dark,
      colored, etc. Standard attributes are set by MAGEC automatically; this point
      lets you override them conditionally. Fires for both maintenance and browse functions.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001017">Insertion Points Reference — %INITATB</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%LOCINIT">
    <section>B - Initialization</section>
    <tsklst_label>Browse Function Initialization</tsklst_label>
    <cobol_paragraph>BA105-LOCAT-INIT (BA100-INIT-STORAGE area)</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Fires at the start of the browse (locate/scan/find) mainline, analogous to %INIT
      for maintenance functions. Use to set up work fields, override starting key
      position, intercept the operator's entry, or take action before the MMP's
      standard browse logic begins.
    </purpose>
    <notes>
      Described as "a handy place to intercept the operator's entry and take action
      before the MMP has done much of its standard logic." (cstm_main.htm)
      Also the preferred place to add custom browse function routing logic.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001020">Insertion Points Reference — %LOCINIT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC flow</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm007006">Customization Tutorial — %LOCINIT (custom browse functions)</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm007008">Customization Tutorial — %LOCINIT additional</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%INITWS">
    <section>B - Initialization (Batch)</section>
    <tsklst_label>Batch — Initialize Working Storage</tsklst_label>
    <cobol_paragraph>BA100-INIT-STORAGE (batch MBP)</cobol_paragraph>
    <fires_for>MBP-ALL</fires_for>
    <purpose>
      Batch-only. Fires at the start of the MBP to initialize working storage fields,
      open files, or perform any one-time setup needed before the batch mainline begins.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001056">Insertion Points Reference — %INITWS</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP flow</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION C — SCREEN HANDLING
       Controls what appears on the screen: blanking,
       filling from data, editing operator input, etc.
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%BLNKSCR">
    <section>C - Screen Handling</section>
    <tsklst_label>Initialize Screen (Blank Screen)</tsklst_label>
    <cobol_paragraph>BB100-BLANK-SCREEN</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC SCN FND</fires_for>
    <purpose>
      Fires just before the screen is blanked/initialized. Allows code to be inserted
      around the screen-blanking step. Rarely customized but available if you need to
      selectively blank or pre-fill certain fields before the standard blank operation.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001003">Insertion Points Reference — %BLNKSCR</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%COMP">
    <section>C - Screen Handling</section>
    <tsklst_label>Computations for Screen Display</tsklst_label>
    <cobol_paragraph>BB200-FILL-SCREEN</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC SCN FND</fires_for>
    <purpose>
      Fires during the screen-filling phase, after database records are read and before
      the screen is sent. Primary use: compute derived or calculated fields to be
      displayed on-screen (e.g. calculated totals, formatted values, cross-file lookups
      whose results populate display-only fields).
    </purpose>
    <notes>
      This is the most common place for display-side calculations. Analogous in purpose
      to a "before screen" event. Works in conjunction with %JOIN for logical join data.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001005">Insertion Points Reference — %COMP</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm023001">Customization Tutorial — %COMP</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%EDIT">
    <section>C - Screen Handling</section>
    <tsklst_label>Screen Field Edit(s) — Phase 1</tsklst_label>
    <cobol_paragraph>BB500-SCREEN-EDIT</cobol_paragraph>
    <fires_for>CHG ADD DUP</fires_for>
    <purpose>
      Fires before any database updating, after the operator has entered data and
      pressed ENTER. Insert cross-field validation, business edits, range checks, or
      any custom validation of operator-entered screen data. Setting an error flag
      or moving an error message to SERRMSG here will abort the update and re-display
      the screen with the error.
    </purpose>
    <notes>
      Phase 1 edits — fires before %EDIT2. Use this for the majority of custom
      validation logic. Does NOT fire for SEE or DEL (no data entry in those flows).
      The %EDIT2 point (Phase 2) fires after %EDIT and allows a second pass of edits
      that may depend on results from %EDIT.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001009">Insertion Points Reference — %EDIT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update phase</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD post-edit phase</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm004004">Customization Tutorial — %EDIT</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm023002">Customization Tutorial — %EDIT advanced</ref>
      <ref url="https://magec.com/DOC/data_main.htm#data008003">Database Administration Tutorial — %EDIT</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%EDIT2">
    <section>C - Screen Handling</section>
    <tsklst_label>Phase 2 Edits</tsklst_label>
    <cobol_paragraph>BB500-SCREEN-EDIT (second pass)</cobol_paragraph>
    <fires_for>CHG ADD DUP</fires_for>
    <purpose>
      Phase 2 of screen edit validation. Fires immediately after %EDIT. Use for edits
      that depend on the results of %EDIT phase 1, or for a logical separation of
      validation concerns (e.g. first pass: field-level; second pass: cross-record).
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001010">Insertion Points Reference — %EDIT2</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update phase</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD post-edit phase</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%LOCMOV">
    <section>C - Screen Handling</section>
    <tsklst_label>Additional Data to Browse Screen</tsklst_label>
    <cobol_paragraph>CA700-MOVE-TO-WORK-AREA</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Fires during the browse screen fill phase, after each record is read and before
      it is placed into the browse display. Allows custom data to be moved into browse
      display fields — e.g. computed values, data from logically joined records,
      or conditional field formatting for each row in the browse list.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001023">Insertion Points Reference — %LOCMOV</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC flow</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm023001">Customization Tutorial — %LOCMOV</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%NORMKEY">
    <section>C - Screen Handling</section>
    <tsklst_label>Additional Edit Routine for MMP Maint. Key</tsklst_label>
    <cobol_paragraph>BA300-NORMALIZE-KEY / BA400-NORMALIZE-MAINT-KEY</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP</fires_for>
    <purpose>
      Fires during key normalization — after the operator enters a key value on the
      top line of the screen, before MAGEC uses it to access the database. Allows
      custom formatting, zero-filling, translation, or validation of the key value
      before the record read is attempted.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001026">Insertion Points Reference — %NORMKEY</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%SNDSCRN">
    <section>C - Screen Handling</section>
    <tsklst_label>Send Screen (before EXEC CICS SEND)</tsklst_label>
    <cobol_paragraph>AA800-SEND-SCREEN</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC SCN FND</fires_for>
    <purpose>
      Fires immediately before the CICS SEND MAP command is executed to display the
      screen to the operator. Final opportunity to set or override any screen field
      values or attributes before the screen is physically sent.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001039">Insertion Points Reference — %SNDSCRN</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags007000">Processing Diagrams — DEL confirm</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD completion</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%PFKEYL">
    <section>C - Screen Handling</section>
    <tsklst_label>PF Key Logic (Browse)</tsklst_label>
    <cobol_paragraph>AAL200-BROWSE-MAINLINE PF-key handling area</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Insert custom PF key handling logic for browse functions. Allows the developer
      to trap specific PF keys pressed while on a browse screen and route to custom logic.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001027">Insertion Points Reference — %PFKEYL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%PFKEYM">
    <section>C - Screen Handling</section>
    <tsklst_label>PF Key Logic (Maintenance)</tsklst_label>
    <cobol_paragraph>AAM200-MAINTENANCE-MAINLINE PF-key handling area</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP</fires_for>
    <purpose>
      Insert custom PF key handling logic for maintenance functions (SEE, CHG, ADD,
      DEL, DUP). Allows trapping PF keys and routing to developer-defined logic,
      e.g. PF keys for custom sub-functions, pop-up windows, or special navigation.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001028">Insertion Points Reference — %PFKEYM</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029005">Customization Tutorial — %PFKEYM</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION D — DATABASE COMMANDS
       Insertion points that wrap or replace MAGECIO calls.
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%ADDINIT">
    <section>D - Database Commands</section>
    <tsklst_label>Initialize Record for ADD</tsklst_label>
    <cobol_paragraph>BB600-BUILD-REC (ADD initialization)</cobol_paragraph>
    <fires_for>ADD</fires_for>
    <purpose>
      Fires when the ADD function initializes a new record before the blank screen is
      displayed. Use to pre-populate fields with default values, system-generated keys,
      or data carried from a prior context before the operator sees the blank ADD screen.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001001">Insertion Points Reference — %ADDINIT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD completion</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029003">Customization Tutorial — %ADDINIT</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029004">Customization Tutorial — %ADDINIT context</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%ADDIT">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to ADD to Database</tsklst_label>
    <cobol_paragraph>AAM710-ADD-TO-DATABASE</cobol_paragraph>
    <fires_for>ADD</fires_for>
    <purpose>
      Wraps the MAGECIO ADDIT command. Code placed here fires just before (or replaces)
      the standard database add operation. Use to set fields that must be computed at
      write time, enforce system-generated values, or perform pre-add actions.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001002">Insertion Points Reference — %ADDIT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD completion</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %ADDIT</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029003">Customization Tutorial — %ADDIT context</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%UPDAT">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to UPDATE the Database</tsklst_label>
    <cobol_paragraph>AAM720-UPDATE-DATABASE</cobol_paragraph>
    <fires_for>CHG</fires_for>
    <purpose>
      Wraps the MAGECIO UPDAT command. Fires just before the standard database update
      (rewrite) is issued for a CHG function. Use to perform final field computations,
      set audit data not handled by the Audit Stamp, or conditionally override the update.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001043">Insertion Points Reference — %UPDAT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update phase</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %UPDAT</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029003">Customization Tutorial — %UPDAT context</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%DELET">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to DELETE from Database</tsklst_label>
    <cobol_paragraph>AAM730-DELETE-FROM-DATABASE</cobol_paragraph>
    <fires_for>DEL</fires_for>
    <purpose>
      Wraps the MAGECIO DELET command. Fires just before the database delete (or
      pseudodelete) is issued. Use to cascade deletions to related records, archive
      data before deletion, or conditionally block a deletion.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001008">Insertion Points Reference — %DELET</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags007000">Processing Diagrams — DEL execute phase</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %DELET</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%DELEDIT">
    <section>D - Database Commands</section>
    <tsklst_label>Edit for Delete (pre-delete validation)</tsklst_label>
    <cobol_paragraph>BB400-EDIT-FOR-DELETE</cobol_paragraph>
    <fires_for>DEL</fires_for>
    <purpose>
      Fires when the operator confirms a delete (presses ENTER on the DEL confirmation
      screen), before the actual delete is executed. Use to validate whether the delete
      is permissible — e.g. referential integrity checks, checking for dependent records,
      or operator confirmation prompts.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001007">Insertion Points Reference — %DELEDIT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags007000">Processing Diagrams — DEL execute</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%RDUKY">
    <section>D - Database Commands</section>
    <tsklst_label>Read for Update Routine (CHG)</tsklst_label>
    <cobol_paragraph>AAM420-READ-BY-KEY-FOR-UPDATE</cobol_paragraph>
    <fires_for>CHG</fires_for>
    <purpose>
      Wraps the MAGECIO LOCKY/RDUKY (read for exclusive update) command sequence.
      Fires around the exclusive-lock read in the CHG flow. Use to supplement or
      replace the standard LOCKY/RDUKY logic, e.g. reading additional related records
      under exclusive control, or handling special lock conditions.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001030">Insertion Points Reference — %RDUKY</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD (RDUKY context)</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%REDKY">
    <section>D - Database Commands</section>
    <tsklst_label>Read for Display Routine (SEE/DEL display)</tsklst_label>
    <cobol_paragraph>AAM410-READ-BY-KEY</cobol_paragraph>
    <fires_for>SEE DEL DUP</fires_for>
    <purpose>
      Wraps the MAGECIO REDKY (read by key, display-only) command. Fires around the
      non-exclusive read used for SEE, DEL display, and DUP. Use to supplement or
      handle special read conditions, or read additional related data concurrently.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001031">Insertion Points Reference — %REDKY</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL display</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD/DUP read</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029003">Customization Tutorial — %REDKY</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm004006">Customization Tutorial — %REDKY advanced</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%REDLE">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to Read FIRST Record (Browse)</tsklst_label>
    <cobol_paragraph>AAL420-READ-FIRST-RECORD</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Wraps the MAGECIO REDLE (read less-than-or-equal / first record) command for
      browse positioning. Fires when the browse is positioning to the starting record.
      Use to implement custom positioning logic or to filter which record is treated
      as the first.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001032">Insertion Points Reference — %REDLE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %REDLE</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%REDNX">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to READ-NEXT Record (Browse)</tsklst_label>
    <cobol_paragraph>AAL430-READ-NEXT-RECORD (also AAM430)</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Wraps the MAGECIO REDNX (read next) command during browse scrolling. Fires on
      each successive read-next during a browse page. Use to implement custom record
      filtering, skip logic, or supplemental data reads for each browse row.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001033">Insertion Points Reference — %REDNX</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %REDNX</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%RELES">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to DROP Exclusive Control</tsklst_label>
    <cobol_paragraph>AAM740-RELEASE-EXCL-CONTROL</cobol_paragraph>
    <fires_for>CHG DEL</fires_for>
    <purpose>
      Wraps the MAGECIO RELES command that releases exclusive (update) control of a
      record after a CHG or DEL. Fires around the release step. Use if you need to
      perform additional operations before or after releasing lock control.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001034">Insertion Points Reference — %RELES</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update phase</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %RELES</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%LOCKY">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to SETL / Position for Update</tsklst_label>
    <cobol_paragraph>AAL410-SET-STARTING-POSITION</cobol_paragraph>
    <fires_for>LOC SCN FND CHG DEL</fires_for>
    <purpose>
      Wraps or supplements the MAGECIO LOCKY (lock / set position) command used to
      establish exclusive control or position for a browse. Use to implement custom
      positioning logic, manage lock acquisition, or handle lock-conflict conditions.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001021">Insertion Points Reference — %LOCKY</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %LOCKY</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%LOCLITS">
    <section>D - Database Commands</section>
    <tsklst_label>Locate Literals (browse key setup)</tsklst_label>
    <cobol_paragraph>Within browse positioning logic</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Insert literal values or computed data into the browse key fields just before
      the LOCKY/REDLE positioning call. Use to override or supplement the starting
      key value that the browse will use to position.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001022">Insertion Points Reference — %LOCLITS</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%LOCVARS">
    <section>D - Database Commands</section>
    <tsklst_label>Locate Variables (browse work area setup)</tsklst_label>
    <cobol_paragraph>Within browse positioning setup logic</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Insert code to set up work variables used during browse positioning.
      Fires before the LOCKY/REDLE commands during LOC/SCN/FND initialization.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001024">Insertion Points Reference — %LOCVARS</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%NKLOC">
    <section>D - Database Commands</section>
    <tsklst_label>Normalize Key for LOC/Browse</tsklst_label>
    <cobol_paragraph>BA300-NORMALIZE-KEY (browse variant)</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Fires during key normalization for browse functions, analogous to %NORMKEY for
      maintenance. Allows formatting, zero-filling, or transformation of the browse
      starting key value entered by the operator before the browse positioning read.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001025">Insertion Points Reference — %NKLOC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%SKEYBLD">
    <section>D - Database Commands</section>
    <tsklst_label>Build Secondary/Subordinate Key</tsklst_label>
    <cobol_paragraph>CA800-BUILD-SKEY</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Fires when building the secondary (subordinate/alternate) key value for browse
      functions that use a non-primary key. Use to construct composite secondary keys
      or to derive the key value from screen input or other data.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001038">Insertion Points Reference — %SKEYBLD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%JOIN">
    <section>D - Database Commands</section>
    <tsklst_label>Logic to JOIN Secondary Files</tsklst_label>
    <cobol_paragraph>JA100-LOGICAL-JOIN (via BB100-LOGICAL-JOIN)</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC SCN FND MBP-BROWSE MBP-MAINT</fires_for>
    <purpose>
      Fires after every successful read of the Primary Data Class record, to perform
      Logical Join reads of secondary (related) Data Classes. This is the standard
      mechanism for reading related records from other files and making their data
      available to the screen and procedure division logic as a "Logical Record."
      Also used to perform calculated field computations that depend on primary record data.
    </purpose>
    <notes>
      The Automatic Logical Join feature (in application development) auto-generates
      %JOIN code. You can supplement or replace it here. The first line of auto-generated
      code typically tests IF (NOT-FOUND) GO TO JA900-RETURN to guard against missing
      primary records. Always preserve this guard when adding to auto-generated %JOIN code.
      Fires for ALL function types because every function reads the primary record.
    </notes>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001018">Insertion Points Reference — %JOIN (online)</ref>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001057">Insertion Points Reference — %JOIN (batch browse)</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP</ref>
      <ref url="https://magec.com/DOC/app_main.htm#app008001">Application Developer Tutorial — %JOIN</ref>
      <ref url="https://magec.com/DOC/battut_main.htm#battut003011">Batch Developer Tutorial — %JOIN</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm002011">Customization Tutorial — %JOIN</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm002013">Customization Tutorial — %JOIN advanced</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION E — SCREEN NAVIGATION / EXIT
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%GOBACK">
    <section>E - Screen Navigation</section>
    <tsklst_label>MMP Exit Logic</tsklst_label>
    <cobol_paragraph>AA900-GOBACK</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC SCN FND</fires_for>
    <purpose>
      Fires at the point where the MMP is about to return control (EXEC CICS RETURN
      or GOBACK). Use to perform cleanup, logging, or to redirect control to another
      program or transaction before the MMP exits.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001012">Insertion Points Reference — %GOBACK</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags002000">Processing Diagrams — SEE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags004000">Processing Diagrams — CHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags005000">Processing Diagrams — SCN/FND</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags006000">Processing Diagrams — DEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags007000">Processing Diagrams — DEL confirm</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags008000">Processing Diagrams — ADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags010000">Processing Diagrams — DUP</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD completion</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION F — POST-DATABASE-UPDATE OUTCOMES
       Fires after a successful database operation.
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%GOODADD">
    <section>F - Post-Update Outcomes</section>
    <tsklst_label>After Successful ADD</tsklst_label>
    <cobol_paragraph>AAM753-GOODADD</cobol_paragraph>
    <fires_for>ADD</fires_for>
    <purpose>
      Fires immediately after a successful ADDIT (record added to database). Use for
      post-add logic: trigger cascading adds to related files, send notifications,
      chain to another function, or log the addition.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001013">Insertion Points Reference — %GOODADD</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD completion</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029004">Customization Tutorial — %GOODADD</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%GOODCHG">
    <section>F - Post-Update Outcomes</section>
    <tsklst_label>After Successful CHG</tsklst_label>
    <cobol_paragraph>AAM755-GOODCHG</cobol_paragraph>
    <fires_for>CHG</fires_for>
    <purpose>
      Fires immediately after a successful UPDAT (record updated in database). Use for
      post-change logic: cascade updates to related files, trigger downstream processes,
      chain to another function, or audit the change.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001014">Insertion Points Reference — %GOODCHG</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update phase</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm029004">Customization Tutorial — %GOODCHG</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%GOODDEL">
    <section>F - Post-Update Outcomes</section>
    <tsklst_label>After Successful DEL</tsklst_label>
    <cobol_paragraph>AAM757-GOODDEL</cobol_paragraph>
    <fires_for>DEL</fires_for>
    <purpose>
      Fires immediately after a successful DELET (record deleted from database). Use for
      post-delete logic: cascade deletions to child records, archive data, free associated
      resources, or log the deletion.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001015">Insertion Points Reference — %GOODDEL</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags007000">Processing Diagrams — DEL execute phase</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%UPDERR">
    <section>F - Post-Update Outcomes</section>
    <tsklst_label>After Update ERROR</tsklst_label>
    <cobol_paragraph>AAM751-UPDERR</cobol_paragraph>
    <fires_for>CHG ADD DEL DUP</fires_for>
    <purpose>
      Fires when MAGECIO returns an error condition from an ADDIT, UPDAT, or DELET
      command (e.g. duplicate key on ADD, record changed by another user during CHG).
      Use to provide custom error handling, user-friendly messages, or recovery logic
      beyond the standard MAGEC error handling.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001044">Insertion Points Reference — %UPDERR</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags007000">Processing Diagrams — DEL error path</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG error path</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD error path</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION G — SUBROUTINES
       Insertion points for custom subroutine paragraphs.
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%SUBRTNL">
    <section>G - Subroutines (Browse)</section>
    <tsklst_label>Custom Subroutines for Browse MMP</tsklst_label>
    <cobol_paragraph>End of browse mainline — custom subroutine paragraph area</cobol_paragraph>
    <fires_for>LOC SCN FND</fires_for>
    <purpose>
      Place custom COBOL subroutine paragraphs (PERFORMed routines) for use within
      browse function logic. Paragraphs placed here are available to be PERFORMed
      from %LOCINIT, %LOCMOV, %PFKEYL, or other browse insertion points.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001041">Insertion Points Reference — %SUBRTNL</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%SUBRTNM">
    <section>G - Subroutines (Maintenance)</section>
    <tsklst_label>Custom Subroutines for Maintenance MMP</tsklst_label>
    <cobol_paragraph>End of maintenance mainline — custom subroutine paragraph area</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP</fires_for>
    <purpose>
      Place custom COBOL subroutine paragraphs for use within maintenance function logic.
      Paragraphs placed here are available to be PERFORMed from %INIT, %EDIT, %JOIN,
      %GOODADD, %GOODCHG, %GOODDEL, %PFKEYM, or other maintenance insertion points.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001042">Insertion Points Reference — %SUBRTNM (online)</ref>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001068">Insertion Points Reference — %SUBRTNM (batch)</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm027001">Customization Tutorial — %SUBRTNM</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION H — SPOOLER / PRINT
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%SPOOL">
    <section>H - Spooler</section>
    <tsklst_label>Spool / Print Output</tsklst_label>
    <cobol_paragraph>CB900-SPOOL</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP (when print action triggered)</fires_for>
    <purpose>
      Fires when the MMP is to produce spooled (printed) output via the MAGEC TP Spooler.
      Used to format and write lines to the spool file. Relevant when an MMP has a
      "hardcopy" PF key or automatic print capability.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001040">Insertion Points Reference — %SPOOL</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION I — BATCH MBP INSERTION POINTS
       The following insertion points apply primarily
       to MAGEC Batch Programs (MBPs), not online MMPs.
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%ACCUMS">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Accumulators Area (batch report)</tsklst_label>
    <cobol_paragraph>ACCUMULATORS-AREA (WORKING-STORAGE, batch)</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Define accumulator (total) fields in the batch MBP's WORKING-STORAGE.
      These are typically numeric fields used to accumulate running totals for
      report subtotals and grand totals.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001047">Insertion Points Reference — %ACCUMS</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%ADDTOT">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Add to Totals (batch report accumulation)</tsklst_label>
    <cobol_paragraph>CA130-ADD-TOTALS</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires for each record processed in a batch report, to add values to running
      accumulators defined in %ACCUMS.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001048">Insertion Points Reference — %ADDTOT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%BREAKS">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Control Breaks (batch report)</tsklst_label>
    <cobol_paragraph>CA115-CHECK-FOR-BREAKS</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires to check for control breaks in a batch report (e.g. change in department,
      customer, or date). When a break is detected, triggers subtotal printing and
      accumulator reset logic.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001049">Insertion Points Reference — %BREAKS</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%BRKPRT">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Break Print (print subtotals at control break)</tsklst_label>
    <cobol_paragraph>DC200-BREAK-PRINT</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires to print subtotal lines when a control break occurs. Code placed here
      formats and writes the subtotal/break lines to the report.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001050">Insertion Points Reference — %BRKPRT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%EOJ">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>End of Job (batch)</tsklst_label>
    <cobol_paragraph>CA190-END</cobol_paragraph>
    <fires_for>MBP-ALL</fires_for>
    <purpose>
      Fires at the end of a batch MBP run, after all records have been processed.
      Use for final grand total printing, closing files, writing summary records,
      or any end-of-job cleanup.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001052">Insertion Points Reference — %EOJ</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%HDGPRT">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Heading Print (batch report page heading)</tsklst_label>
    <cobol_paragraph>DA200-HDG</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires when a new page heading is to be printed in a batch report (at start of
      run and on each page overflow). Code placed here formats and writes page heading
      lines to the report.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001055">Insertion Points Reference — %HDGPRT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%MVTOPRT">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Move to Print Area (batch report detail line)</tsklst_label>
    <cobol_paragraph>CA130-ADD-TOTALS / detail line area</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires for each record to move data fields into the print line area before the
      detail line is printed. Format each detail line of the report here.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001061">Insertion Points Reference — %MVTOPRT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%ROLLAC">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Roll Accumulators (reset after break print)</tsklst_label>
    <cobol_paragraph>DC100-ROLL-ACCUMULATORS</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires after a control-break subtotal is printed, to roll up (or reset) accumulator
      values for the next control group.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001065">Insertion Points Reference — %ROLLAC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%RPTEND">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Report End (final grand totals)</tsklst_label>
    <cobol_paragraph>CA190-END (report termination)</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires at the very end of the report run to print grand total lines. Distinct
      from %EOJ in that it is specifically for final total printing, whereas %EOJ
      is for all end-of-job logic.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001066">Insertion Points Reference — %RPTEND</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%SVPREV">
    <section>I - Batch Report (MBP)</section>
    <tsklst_label>Save Previous Key (for break detection)</tsklst_label>
    <cobol_paragraph>CA120-SAVE-KEYS</cobol_paragraph>
    <fires_for>MBP-REPORT</fires_for>
    <purpose>
      Fires after each record is processed to save the current control-break key values
      as "previous" values for comparison on the next record pass, enabling break detection.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001069">Insertion Points Reference — %SVPREV</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags013000">Processing Diagrams — MBP report</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION J — BATCH MBP: FILE DEFINITIONS
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%FILEFD">
    <section>J - Batch File Definitions (MBP)</section>
    <tsklst_label>File FD Definitions (batch)</tsklst_label>
    <cobol_paragraph>DATA DIVISION — FILE SECTION (batch MBP)</cobol_paragraph>
    <fires_for>MBP-ALL</fires_for>
    <purpose>
      Insert COBOL FD (File Description) entries into the FILE SECTION of a batch MBP.
      Used when the batch program needs to access non-MAGECIO files (e.g. sequential
      print files, work files) that require explicit FD definitions.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001053">Insertion Points Reference — %FILEFD</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%FILES">
    <section>J - Batch File Definitions (MBP)</section>
    <tsklst_label>File Record Definitions (batch)</tsklst_label>
    <cobol_paragraph>DATA DIVISION — FILE SECTION record definitions (batch MBP)</cobol_paragraph>
    <fires_for>MBP-ALL</fires_for>
    <purpose>
      Insert COBOL 01-level record definitions for files declared in %FILEFD.
      Pairs with %FILEFD to complete the file description in the batch MBP's DATA DIVISION.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001054">Insertion Points Reference — %FILES</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION K — BATCH MBP: BROWSE/MAINTAIN SPECIFIC
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%MGLOCKY">
    <section>K - Batch Browse/Maintain (MBP)</section>
    <tsklst_label>Batch Locate/Position (MBP browse)</tsklst_label>
    <cobol_paragraph>BA102-START-BROWSE</cobol_paragraph>
    <fires_for>MBP-BROWSE</fires_for>
    <purpose>
      Batch equivalent of %LOCKY. Fires during the MBP browse starting-position setup.
      Used to control how the batch program positions to its starting record.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001058">Insertion Points Reference — %MGLOCKY</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP flow</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%MGREDLE">
    <section>K - Batch Browse/Maintain (MBP)</section>
    <tsklst_label>Batch Read First Record (MBP browse)</tsklst_label>
    <cobol_paragraph>BA102-START-BROWSE (REDLE variant)</cobol_paragraph>
    <fires_for>MBP-BROWSE</fires_for>
    <purpose>
      Batch equivalent of %REDLE. Fires when the MBP reads its first/starting record
      during the batch browse mainline.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001059">Insertion Points Reference — %MGREDLE</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP flow</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%MGREDNX">
    <section>K - Batch Browse/Maintain (MBP)</section>
    <tsklst_label>Batch Read Next Record (MBP browse)</tsklst_label>
    <cobol_paragraph>BA110-READ-NEXT</cobol_paragraph>
    <fires_for>MBP-BROWSE</fires_for>
    <purpose>
      Batch equivalent of %REDNX. Fires on each successive read-next during the
      batch browse mainline loop.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001060">Insertion Points Reference — %MGREDNX</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP flow</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%MVTOSRT">
    <section>K - Batch Browse/Maintain (MBP)</section>
    <tsklst_label>Move to Sort Area (MBP)</tsklst_label>
    <cobol_paragraph>BA150-RELEASE (sort release area)</cobol_paragraph>
    <fires_for>MBP-BROWSE</fires_for>
    <purpose>
      Fires during MBP processing to move record data into the sort work area before
      RELEASEing records to an internal sort. Used in MBPs that sort their input data.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001062">Insertion Points Reference — %MVTOSRT</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP flow</ref>
    </doc_refs>
  </insertion_point>

  <insertion_point name="%SELECT">
    <section>K - Batch Browse/Maintain (MBP)</section>
    <tsklst_label>Select/Filter Records (MBP)</tsklst_label>
    <cobol_paragraph>BA115-SELECT</cobol_paragraph>
    <fires_for>MBP-BROWSE</fires_for>
    <purpose>
      Fires for each record read during an MBP browse pass, to allow the developer
      to implement record selection/filter logic. Setting a "skip" or "not selected"
      flag here causes the record to be bypassed in processing.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001067">Insertion Points Reference — %SELECT</ref>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001037">Insertion Points Reference — %SELECT (online)</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags003000">Processing Diagrams — LOC (online equivalent)</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags012000">Processing Diagrams — MBP</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm007014">Customization Tutorial — %SELECT</ref>
    </doc_refs>
  </insertion_point>

  <!-- ═══════════════════════════════════════════════
       SECTION L — CALC (Batch calculation point)
       ═══════════════════════════════════════════════ -->

  <insertion_point name="%CALC">
    <section>L - Calculations</section>
    <tsklst_label>Calculations (online and batch)</tsklst_label>
    <cobol_paragraph>Within mainline — calculation area</cobol_paragraph>
    <fires_for>SEE CHG ADD DEL DUP LOC MBP-BROWSE MBP-REPORT</fires_for>
    <purpose>
      A general-purpose calculation insertion point that fires during record processing
      to perform arithmetic, data derivation, or any computational logic. Can be used
      in both online MMPs and batch MBPs to compute values before display or write operations.
    </purpose>
    <doc_refs>
      <ref url="https://magec.com/DOC/insert_main.htm#insert001004">Insertion Points Reference — %CALC</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags009000">Processing Diagrams — CHG update</ref>
      <ref url="https://magec.com/DOC/diags_main.htm#diags011000">Processing Diagrams — ADD completion</ref>
      <ref url="https://magec.com/DOC/cstm_main.htm#cstm023003">Customization Tutorial — %CALC</ref>
    </doc_refs>
  </insertion_point>

</magec_insertion_points>