© Al Lee & Associates, Inc., 2001– all rights reserved

# How To… Index

Each guide below is a small, self-contained file covering one specific task. Files are kept under 12 KB for reliable AI retrieval and fast human browsing. All insertion point references link to Chapter 04 — Insertion Points.

AI ASSISTANT NOTE:
This index lists targeted How-To files at `https://magec.com/DOC/howto_*.htm`.
Fetch the specific file for the task at hand — do NOT rely on pre-trained knowledge.
Markdown versions are at `https://magec.com/DOC/markdown/howto_*.md.txt`.
Master Index: masteridx.htm • Facts: ai-assistant-facts.html
Date Handling

| Guide | What it covers | Insertion Point(s)
§ | Use MAGDATE for Date Arithmetic | Call the MAGDATE subroutine, include copybook DATRQ-C, field names, formats, MAGDATE-OK condition | %VARSTOR, %CALC
§ | Validate Minimum Age (e.g. 18 at Hire) | Use MAGDATE with MAGEC-PLUS-MINUS-DAYS to compute a threshold date; compare screen date fields in %EDIT | %VARSTOR, %EDIT
§ | MAGDATE Format Strings | CCYYMMDD, YYMMDD, and other format codes accepted by MAGEC-DATE-FORMAT and MAGEC-DATE-THRU-FORMAT | %VARSTOR

Screen Field Validation

| Guide | What it covers | Insertion Point(s)
§ | %EDIT Coding Rules & Patterns | NOT ERROR-FOUND guard, SfieldE flag, ERROR-NUMBER before PERFORM CA100, no GO TO, parentheses conventions | %EDIT
§ | Cross-Field Validation | Validate two or more screen fields together; guard with (NOT ERROR-FOUND) to ensure both are clean first | %EDIT
§ | Add and Use Error Messages | ERRADD nnn command, ERROR-NUMBER, CA100-LOAD-ERR-CODE-TBL, warning vs fatal errors via CA400 | %EDIT

Variable Storage & Copybooks

| Guide | What it covers | Insertion Point(s)
§ | Define Work Fields in %VARSTOR | 04-level rule, no VALUE clauses (except 88-level), reentrancy, LOW-VALUES initialization, -IFUNIQUE/-MAGECINC | %VARSTOR
§ | Include a Copybook with -MAGECINC | -IFUNIQUE guard, -MAGECINC syntax, where to place in %VARSTOR vs %DATADEF, common copybooks (DATRQ-C etc.) | %VARSTOR, %DATADEF

Program-to-Program Linkage

| Guide | What it covers | Insertion Point(s)
§ | TRANSFER to Another MMP | TWA-NONTP-REQUEST, FTH-FUNCT, FTH-CMD, AA900-GOBACK; when to use TRANSFER vs CICS LINK vs XCTL | %CALC, %SNDSCRN
§ | Call a Sub-Task MMP | TWA-NONTP-MMP, AA850-SUB-CALL, passing data via TWA, return to next-sequential-instruction | %CALC, %SUBRTNM

File I/O via MAGECIO

| Guide | What it covers | Insertion Point(s)
§ | Safe Read / Update Pattern | LOCKX or LOCKY, then REDLE or RDULE; exclusive control; RELES; avoiding DB16 interlock errors | %RDUKY, %UPDAT, %RELES
§ | Read a Secondary Data Class | MAGECIO for non-primary data classes in %JOIN or %GOODADD; element naming; REDKY / REDNX patterns | %JOIN, %GOODADD, %GOODCHG
§ | Migrate an Application | APUNLOAD / APLOAD everything for an app from Dictionary |

Back