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-migration3description: 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<!-- Generated from harness/github-copilot/skills/adabas-postgresql-migration/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# Adabas to PostgreSQL migration910Turn 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.1112## When to invoke1314- "Map this Adabas DDM to a PostgreSQL schema."15- "How should this MU field and PE group be stored?"16- "This packed decimal amount is losing precision after migration."17- "Prove the migrated table matches the legacy file."18- "Review this Adabas to PostgreSQL mapping before implementation."1920## Field format mapping2122| Adabas format | PostgreSQL | Rule |23| --- | --- | --- |24| `A` alphanumeric, fixed | `char(n)` or `varchar(n)` | Decide whether trailing blanks are significant before choosing. Legacy comparisons often depend on them. |25| `W` wide | `text` | Confirm the source encoding; do not assume UTF-8. |26| `P` packed decimal | `numeric(p,s)` | Precision and scale come from the DDM or FDT, never from a sample value. |27| `U` unpacked, zoned | `numeric(p,s)` | Same rule as `P`. Check the sign representation in the trailing byte. |28| `B` binary | `bytea`, `integer`, or `bigint` | Choose an integer type only when the field is a documented number, not a bit field. |29| `F` floating | `real` or `double precision` | Never use it for money, quantities, or anything that is summed and compared. |30| `L` logical | `boolean` | Map the legacy true value explicitly; blank is not automatically false. |31| Date as `N8` or `A8` | `date` | Confirm the stored pattern, usually `YYYYMMDD`, and reject impossible values instead of coercing them. |32| Time as numeric | `time` or `timestamp` | State the time zone assumption, or store local time with a documented rule. |33| Natural `D` and `T` | `date`, `timestamp` | Natural date arithmetic uses a day origin; verify the epoch before converting. |3435Monetary and quantity fields keep exact decimal types end to end: `numeric` in PostgreSQL, `BigDecimal`36in Java, and a string in JSON. A single conversion through a binary floating type is enough to break a37reconciliation.3839## Structure mapping4041| Adabas structure | Default PostgreSQL shape | Use an alternative only when |42| --- | --- | --- |43| File | Table | Never merge two files into one table without a recorded decision. |44| Elementary field | Column | The field is a documented composite that programs always split. |45| 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. |46| 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. |47| MU inside PE | Grandchild table with both ordinals | Never. Both occurrence dimensions are meaningful. |48| Descriptor | Index on the mapped column | The descriptor is unused by every inspected program. |49| 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. |50| Subdescriptor | Expression index on the same substring | The substring is not an access path in any inspected program. |51| ISN | Surrogate key plus a retained `legacy_isn` column | Never expose ISN as business identity; it is a physical address. |5253Store the occurrence ordinal explicitly. Adabas occurrence position is often load-bearing in reports,54control breaks, and "first occurrence wins" logic.5556## Identity and integrity5758- Adabas enforces no referential integrity. A foreign key is a hypothesis derived from observed program59 behavior, not from a descriptor name. Cite the program and line that establishes the relationship.60- A descriptor is an access path. Uniqueness must be proven against the data before a unique constraint61 is added; a unique index that fails on load is evidence the assumption was wrong.62- Keep `legacy_isn` and the legacy file identity for the life of the reconciliation, then decide63 explicitly whether to retain or drop them.64- Add a constraint only when the legacy behavior actually rejects the value. A constraint the legacy65 system never enforced turns a load into a silent data-loss event.6667## Semantic traps6869- **Empty is not null.** Adabas suppresses empty values, and a null-indicator value is distinct from a70 blank or zero. Decide the mapping per field and record it; a blanket `NULL` mapping changes behavior.71- **Zero occurrences.** An MU or PE with no occurrences is not the same as one occurrence holding a72 default. Absence must survive the migration.73- **Sign handling.** Packed and unpacked values carry the sign in the last nibble or byte. A wrong read74 silently flips a sign on a subset of rows.75- **Shortened values on load.** Widening a column hides a legacy length rule that programs relied on.76 Preserve the rule explicitly or record it as an accepted deviation.77- **Character comparison.** Legacy comparisons on fixed-length fields include trailing blanks. Moving to78 `varchar` changes equality results.79- **Denormalized redundancy.** A value duplicated across files is often intentionally stale. Normalizing80 it changes reported history.8182## Reconciliation procedure8384Equivalence is a measurement, not a claim. Run these against the same input and record actual numbers.85861. **Row counts.** Legacy record count per file versus target row count per table.872. **Occurrence counts.** Total MU values and PE occurrences versus child-table row counts.883. **Aggregates per numeric column.** `count`, `count` of non-null, `sum`, `min`, and `max`, compared at89 full precision.904. **Distribution checks.** Distinct-value counts for every mapped descriptor column.915. **Sampled record diff.** Deterministic ordering, a fixed sample, and a field-by-field comparison92 including trailing blanks and occurrence order.936. **Edge-case set.** Maximum occurrences, zero occurrences, negative and zero amounts, boundary94 precision, suppressed empty values, and the longest alphanumeric values.9596Report every number that was produced and every check that could not run. A reconciliation reported97without numbers is not evidence.9899## Safety100101- Fixtures and examples use synthetic data. Never copy production records, personal identifiers, or real102 monetary values into the repository, tests, logs, or issue text.103- Migration scripts are re-runnable against an empty target and never mutate the legacy source.104- Credentials come from the environment or a managed identity, never from a script, migration file, or105 connection string in version control.106- A destructive load step requires an explicit flag and a recorded approval.107108## Limits109110- This skill maps structure and proves data equivalence. It does not extract business meaning; use a111 business-rule extraction capability for that.112- It does not tune the resulting schema; use a PostgreSQL optimization capability after the mapping is113 correct.114- It does not decide scope, priority, or which files migrate first.115- Reconciliation proves that data matches. It does not prove that behavior matches; that needs116 characterization tests against the legacy outputs.117118## Output template119120```markdown121## Adabas to PostgreSQL mapping122123**Status:** proposed | reviewed | reconciled | blocked124**Scope:** <Adabas file or DDM>125126### Column mapping127| Adabas field | Format | Target column | Type | Rule or risk | Evidence |128| --- | --- | --- | --- | --- | --- |129130### Structure mapping131| Structure | Target shape | Rationale | Evidence |132| --- | --- | --- | --- |133134### Access paths135| Descriptor | Target index | Uniqueness proven | Evidence |136| --- | --- | --- | --- |137138### Reconciliation139| Check | Legacy value | Target value | Match | Evidence |140| --- | --- | --- | --- | --- |141142### Open questions and accepted deviations143- <question or deviation, owner, decision reference>144```145146## Quality gate147148- [ ] Every mapped field cites the DDM or FDT definition rather than a sampled value.149- [ ] Monetary and quantity fields use exact decimal types across every layer.150- [ ] MU and PE structures preserve occurrence identity, order, and zero-occurrence cases.151- [ ] Descriptors, superdescriptors, and subdescriptors map to indexes that match the inspected access paths.152- [ ] Every foreign key and unique constraint cites the program behavior or data proof that justifies it.153- [ ] Empty, null, blank, sign, and length decisions are explicit per field.154- [ ] Reconciliation reports actual counts, aggregates, occurrence totals, and sampled diffs.155- [ ] Checks that could not run are reported as not run, with the blocking reason.156- [ ] No production, personal, or real monetary data entered fixtures, examples, or logs.
Run npx skillmds@latest add paulasilvatech/adabas-postgresql-migration 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.