Model Adabas files, DDM and FDT definitions, MU and PE structures, packed and unpacked numerics, descriptors, and ISN identity as a PostgreSQL schema, then prove equivalence with recorded reconciliation numbers. Use when designing or reviewing an Adabas to PostgreSQL data migration, mapping legacy field formats to column types, deciding child-table versus array storage, or verifying that migrated data matches the legacy source.
Turn inspected Adabas structure into a relational schema that preserves precision, occurrence semantics, and access paths, and prove the result with reconciliation numbers instead of assertions.
When to invoke
"Map this Adabas DDM to a PostgreSQL schema."
"How should this MU field and PE group be stored?"
"This packed decimal amount is losing precision after migration."
"Prove the migrated table matches the legacy file."
"Review this Adabas to PostgreSQL mapping before implementation."
Field format mapping
Adabas format
PostgreSQL
Rule
A alphanumeric, fixed
char(n) or varchar(n)
Decide whether trailing blanks are significant before choosing. Legacy comparisons often depend on them.
W wide
text
Confirm the source encoding; do not assume UTF-8.
P packed decimal
numeric(p,s)
Precision and scale come from the DDM or FDT, never from a sample value.
U unpacked, zoned
numeric(p,s)
Same rule as P. Check the sign representation in the trailing byte.
B binary
bytea, integer, or bigint
Choose an integer type only when the field is a documented number, not a bit field.
F floating
real or double precision
Never use it for money, quantities, or anything that is summed and compared.
L logical
boolean
Map the legacy true value explicitly; blank is not automatically false.
Date as N8 or A8
date
Confirm the stored pattern, usually YYYYMMDD, and reject impossible values instead of coercing them.
Time as numeric
time or timestamp
State the time zone assumption, or store local time with a documented rule.
Natural D and T
date, timestamp
Natural date arithmetic uses a day origin; verify the epoch before converting.
Monetary and quantity fields keep exact decimal types end to end: numeric in PostgreSQL, BigDecimal
in Java, and a string in JSON. A single conversion through a binary floating type is enough to break a
reconciliation.
Structure mapping
Adabas structure
Default PostgreSQL shape
Use an alternative only when
File
Table
Never merge two files into one table without a recorded decision.
Elementary field
Column
The field is a documented composite that programs always split.
MU multiple-value field
Child table with (parent_id, occurrence)
Order and cardinality are bounded, values are never queried or joined individually, and an array is a recorded decision.
PE periodic group
Child table with (parent_id, occurrence) plus one column per group member
Never flatten a PE into numbered columns; occurrence count is data, not schema.
MU inside PE
Grandchild table with both ordinals
Never. Both occurrence dimensions are meaningful.
Descriptor
Index on the mapped column
The descriptor is unused by every inspected program.
Superdescriptor
Composite index, or an index on a generated column when the source concatenates or shortens parts
The parts are already covered by an equivalent composite index.
Subdescriptor
Expression index on the same substring
The substring is not an access path in any inspected program.
ISN
Surrogate key plus a retained legacy_isn column
Never expose ISN as business identity; it is a physical address.
Store the occurrence ordinal explicitly. Adabas occurrence position is often load-bearing in reports,
control breaks, and "first occurrence wins" logic.
Identity and integrity
Adabas enforces no referential integrity. A foreign key is a hypothesis derived from observed program
behavior, not from a descriptor name. Cite the program and line that establishes the relationship.
A descriptor is an access path. Uniqueness must be proven against the data before a unique constraint
is added; a unique index that fails on load is evidence the assumption was wrong.
Keep legacy_isn and the legacy file identity for the life of the reconciliation, then decide
explicitly whether to retain or drop them.
Add a constraint only when the legacy behavior actually rejects the value. A constraint the legacy
system never enforced turns a load into a silent data-loss event.
Semantic traps
Empty is not null. Adabas suppresses empty values, and a null-indicator value is distinct from a
blank or zero. Decide the mapping per field and record it; a blanket NULL mapping changes behavior.
Zero occurrences. An MU or PE with no occurrences is not the same as one occurrence holding a
default. Absence must survive the migration.
Sign handling. Packed and unpacked values carry the sign in the last nibble or byte. A wrong read
silently flips a sign on a subset of rows.
Shortened values on load. Widening a column hides a legacy length rule that programs relied on.
Preserve the rule explicitly or record it as an accepted deviation.
Character comparison. Legacy comparisons on fixed-length fields include trailing blanks. Moving to
varchar changes equality results.
Denormalized redundancy. A value duplicated across files is often intentionally stale. Normalizing
it changes reported history.
Reconciliation procedure
Equivalence is a measurement, not a claim. Run these against the same input and record actual numbers.
Row counts. Legacy record count per file versus target row count per table.
Occurrence counts. Total MU values and PE occurrences versus child-table row counts.
Aggregates per numeric column.count, count of non-null, sum, min, and max, compared at
full precision.
Distribution checks. Distinct-value counts for every mapped descriptor column.
Sampled record diff. Deterministic ordering, a fixed sample, and a field-by-field comparison
including trailing blanks and occurrence order.
Edge-case set. Maximum occurrences, zero occurrences, negative and zero amounts, boundary
precision, suppressed empty values, and the longest alphanumeric values.
Report every number that was produced and every check that could not run. A reconciliation reported
without numbers is not evidence.
Safety
Fixtures and examples use synthetic data. Never copy production records, personal identifiers, or real
monetary values into the repository, tests, logs, or issue text.
Migration scripts are re-runnable against an empty target and never mutate the legacy source.
Credentials come from the environment or a managed identity, never from a script, migration file, or
connection string in version control.
A destructive load step requires an explicit flag and a recorded approval.
Limits
This skill maps structure and proves data equivalence. It does not extract business meaning; use a
business-rule extraction capability for that.
It does not tune the resulting schema; use a PostgreSQL optimization capability after the mapping is
correct.
It does not decide scope, priority, or which files migrate first.
Reconciliation proves that data matches. It does not prove that behavior matches; that needs
characterization tests against the legacy outputs.
Every mapped field cites the DDM or FDT definition rather than a sampled value.
Monetary and quantity fields use exact decimal types across every layer.
MU and PE structures preserve occurrence identity, order, and zero-occurrence cases.
Descriptors, superdescriptors, and subdescriptors map to indexes that match the inspected access paths.
Every foreign key and unique constraint cites the program behavior or data proof that justifies it.
Empty, null, blank, sign, and length decisions are explicit per field.
Reconciliation reports actual counts, aggregates, occurrence totals, and sampled diffs.
Checks that could not run are reported as not run, with the blocking reason.
No production, personal, or real monetary data entered fixtures, examples, or logs.
1---2name: adabas-postgresql-migration-23description: Model Adabas files, DDM and FDT definitions, MU and PE structures, packed and unpacked numerics, descriptors, and ISN identity as a PostgreSQL schema, then prove equivalence with recorded reconciliation numbers. Use when designing or reviewing an Adabas to PostgreSQL data migration, mapping legacy field formats to column types, deciding child-table versus array storage, or verifying that migrated data matches the legacy source.4---56# Adabas to PostgreSQL migration78Turn inspected Adabas structure into a relational schema that preserves precision, occurrence semantics, and access paths, and prove the result with reconciliation numbers instead of assertions.910## When to invoke1112- "Map this Adabas DDM to a PostgreSQL schema."13- "How should this MU field and PE group be stored?"14- "This packed decimal amount is losing precision after migration."15- "Prove the migrated table matches the legacy file."16- "Review this Adabas to PostgreSQL mapping before implementation."1718## Field format mapping1920| Adabas format | PostgreSQL | Rule |21| --- | --- | --- |22| `A` alphanumeric, fixed | `char(n)` or `varchar(n)` | Decide whether trailing blanks are significant before choosing. Legacy comparisons often depend on them. |23| `W` wide | `text` | Confirm the source encoding; do not assume UTF-8. |24| `P` packed decimal | `numeric(p,s)` | Precision and scale come from the DDM or FDT, never from a sample value. |25| `U` unpacked, zoned | `numeric(p,s)` | Same rule as `P`. Check the sign representation in the trailing byte. |26| `B` binary | `bytea`, `integer`, or `bigint` | Choose an integer type only when the field is a documented number, not a bit field. |27| `F` floating | `real` or `double precision` | Never use it for money, quantities, or anything that is summed and compared. |28| `L` logical | `boolean` | Map the legacy true value explicitly; blank is not automatically false. |29| Date as `N8` or `A8` | `date` | Confirm the stored pattern, usually `YYYYMMDD`, and reject impossible values instead of coercing them. |30| Time as numeric | `time` or `timestamp` | State the time zone assumption, or store local time with a documented rule. |31| Natural `D` and `T` | `date`, `timestamp` | Natural date arithmetic uses a day origin; verify the epoch before converting. |3233Monetary and quantity fields keep exact decimal types end to end: `numeric` in PostgreSQL, `BigDecimal`34in Java, and a string in JSON. A single conversion through a binary floating type is enough to break a35reconciliation.3637## Structure mapping3839| Adabas structure | Default PostgreSQL shape | Use an alternative only when |40| --- | --- | --- |41| File | Table | Never merge two files into one table without a recorded decision. |42| Elementary field | Column | The field is a documented composite that programs always split. |43| MU multiple-value field | Child table with `(parent_id, occurrence)` | Order and cardinality are bounded, values are never queried or joined individually, and an array is a recorded decision. |44| PE periodic group | Child table with `(parent_id, occurrence)` plus one column per group member | Never flatten a PE into numbered columns; occurrence count is data, not schema. |45| MU inside PE | Grandchild table with both ordinals | Never. Both occurrence dimensions are meaningful. |46| Descriptor | Index on the mapped column | The descriptor is unused by every inspected program. |47| Superdescriptor | Composite index, or an index on a generated column when the source concatenates or shortens parts | The parts are already covered by an equivalent composite index. |48| Subdescriptor | Expression index on the same substring | The substring is not an access path in any inspected program. |49| ISN | Surrogate key plus a retained `legacy_isn` column | Never expose ISN as business identity; it is a physical address. |5051Store the occurrence ordinal explicitly. Adabas occurrence position is often load-bearing in reports,52control breaks, and "first occurrence wins" logic.5354## Identity and integrity5556- Adabas enforces no referential integrity. A foreign key is a hypothesis derived from observed program57 behavior, not from a descriptor name. Cite the program and line that establishes the relationship.58- A descriptor is an access path. Uniqueness must be proven against the data before a unique constraint59 is added; a unique index that fails on load is evidence the assumption was wrong.60- Keep `legacy_isn` and the legacy file identity for the life of the reconciliation, then decide61 explicitly whether to retain or drop them.62- Add a constraint only when the legacy behavior actually rejects the value. A constraint the legacy63 system never enforced turns a load into a silent data-loss event.6465## Semantic traps6667- **Empty is not null.** Adabas suppresses empty values, and a null-indicator value is distinct from a68 blank or zero. Decide the mapping per field and record it; a blanket `NULL` mapping changes behavior.69- **Zero occurrences.** An MU or PE with no occurrences is not the same as one occurrence holding a70 default. Absence must survive the migration.71- **Sign handling.** Packed and unpacked values carry the sign in the last nibble or byte. A wrong read72 silently flips a sign on a subset of rows.73- **Shortened values on load.** Widening a column hides a legacy length rule that programs relied on.74 Preserve the rule explicitly or record it as an accepted deviation.75- **Character comparison.** Legacy comparisons on fixed-length fields include trailing blanks. Moving to76 `varchar` changes equality results.77- **Denormalized redundancy.** A value duplicated across files is often intentionally stale. Normalizing78 it changes reported history.7980## Reconciliation procedure8182Equivalence is a measurement, not a claim. Run these against the same input and record actual numbers.83841. **Row counts.** Legacy record count per file versus target row count per table.852. **Occurrence counts.** Total MU values and PE occurrences versus child-table row counts.863. **Aggregates per numeric column.** `count`, `count` of non-null, `sum`, `min`, and `max`, compared at87 full precision.884. **Distribution checks.** Distinct-value counts for every mapped descriptor column.895. **Sampled record diff.** Deterministic ordering, a fixed sample, and a field-by-field comparison90 including trailing blanks and occurrence order.916. **Edge-case set.** Maximum occurrences, zero occurrences, negative and zero amounts, boundary92 precision, suppressed empty values, and the longest alphanumeric values.9394Report every number that was produced and every check that could not run. A reconciliation reported95without numbers is not evidence.9697## Safety9899- Fixtures and examples use synthetic data. Never copy production records, personal identifiers, or real100 monetary values into the repository, tests, logs, or issue text.101- Migration scripts are re-runnable against an empty target and never mutate the legacy source.102- Credentials come from the environment or a managed identity, never from a script, migration file, or103 connection string in version control.104- A destructive load step requires an explicit flag and a recorded approval.105106## Limits107108- This skill maps structure and proves data equivalence. It does not extract business meaning; use a109 business-rule extraction capability for that.110- It does not tune the resulting schema; use a PostgreSQL optimization capability after the mapping is111 correct.112- It does not decide scope, priority, or which files migrate first.113- Reconciliation proves that data matches. It does not prove that behavior matches; that needs114 characterization tests against the legacy outputs.115116## Output template117118```markdown119## Adabas to PostgreSQL mapping120121**Status:** proposed | reviewed | reconciled | blocked122**Scope:** <Adabas file or DDM>123124### Column mapping125| Adabas field | Format | Target column | Type | Rule or risk | Evidence |126| --- | --- | --- | --- | --- | --- |127128### Structure mapping129| Structure | Target shape | Rationale | Evidence |130| --- | --- | --- | --- |131132### Access paths133| Descriptor | Target index | Uniqueness proven | Evidence |134| --- | --- | --- | --- |135136### Reconciliation137| Check | Legacy value | Target value | Match | Evidence |138| --- | --- | --- | --- | --- |139140### Open questions and accepted deviations141- <question or deviation, owner, decision reference>142```143144## Quality gate145146- [ ] Every mapped field cites the DDM or FDT definition rather than a sampled value.147- [ ] Monetary and quantity fields use exact decimal types across every layer.148- [ ] MU and PE structures preserve occurrence identity, order, and zero-occurrence cases.149- [ ] Descriptors, superdescriptors, and subdescriptors map to indexes that match the inspected access paths.150- [ ] Every foreign key and unique constraint cites the program behavior or data proof that justifies it.151- [ ] Empty, null, blank, sign, and length decisions are explicit per field.152- [ ] Reconciliation reports actual counts, aggregates, occurrence totals, and sampled diffs.153- [ ] Checks that could not run are reported as not run, with the blocking reason.154- [ ] No production, personal, or real monetary data entered fixtures, examples, or logs.
Run npx skillmds@latest add paulasilvatech/adabas-postgresql-migration-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Model Adabas files, DDM and FDT definitions, MU and PE structures, packed and unpacked numerics, descriptors, and ISN identity as a PostgreSQL schema, then prove equivalence with recorded reconciliation numbers. Use when designing or reviewing an Adabas to PostgreSQL data migration, mapping legacy field formats to column types, deciding child-table versus array storage, or verifying that migrated data matches the legacy source. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
paulasilvatech (@paulasilvatech) published this skill. Their other Agent Skills are listed on their SkillMD profile.