Commercial deck: PDF (ES) · PPTX (ES) · PDF (EN) · PPTX (EN)
What NSAdaFile is
nsadafile extracts data from Adabas databases and exports it to universal formats: csv, json, xml, tab and record. It supports field selection by short or DDM name, Adabas-syntax searches (-search), SQL queries with JOIN (-sql), descriptor-ordered reads (-sortby), ISN ranges and performance tuning (-multifetch, -blocksize).
Ideal uses:
- Data export for analysis (CSV/JSON).
- Integration with external systems and APIs.
- Backup and migration of information.
- Auditing and diagnostics (
-fdt,-check,-checkfields,-debugmodes).
Database numbers, file numbers, field names and paths in the examples are fictitious.
Use cases
1. Nightly CSV export for analysis
Extract a file with a limit and save it to disk for later processing.
nsadafile -dbid 50 -fnr 15 -limit 10000 -format csv -outfile /tmp/export/customers.csv
2. API integration via JSON
Extract only the required fields and filter by city using Adabas search syntax.
nsadafile -dbid 50 -fnr 15 -search "AB='MADRID'" -fields "AA,AB,AC" -format json -outfile /tmp/export/customers_madrid.json
3. Audit of a record range by ISN
Review the first 500 records in human-readable record format, including the ISN.
nsadafile -dbid 50 -fnr 15 -fromisn 1 -toisn 500 -isn -format record
3b. Reading a single ISN as a form or a list
Show one record: as a form with -format form (alias of record) or as a list with -format list (alias of tab). A missing ISN returns an error.
nsadafile -dbid 50 -fnr 15 -isnq 12345 -format form
nsadafile -dbid 50 -fnr 15 -isnq 12345 -fields "AA,AB" -format list
4. SQL exploitation with DDM names
Query with JOIN across tables defined in the configuration JSON (generated by nsddm).
nsadafile -dbid 50 -config /tmp/cfg/ddm50.json -sql "SELECT AA, AB FROM SAMPLE-CUSTOMER WHERE AB='EXAMPLE CORP'" -format csv
5. DDM vs FDT consistency check
Compare the configuration JSON against the real Adabas FDT before a migration.
nsadafile -dbid 50 -config /tmp/cfg/ddm50.json -check -json -outfile /tmp/export/check.json
6. Field-length validation
Find records whose content exceeds the defined length, before a migration or load. Without -config it uses the live file FDT; with -config/-ddmname it uses the DDM lengths. Only A/W/G/B formats are validated.
nsadafile -dbid 50 -fnr 15 -checkfields -fields "AA,AB" -outfile /tmp/export/overflows.txt
Command reference
Connection and file selection
| Parameter | Description | Required |
|---|---|---|
-dbid | Adabas database ID | Yes |
-fnr | Adabas file number to extract | If -ddmname not used |
-ddmname | DDM name (logical file name from the JSON config). Overrides fnr when config is provided | If -fnr not used |
-config | JSON configuration file with schema definitions | If -ddmname is used |
-input | Alias for -config (DDM JSON file, e.g. ddm50.json) | No |
-etid | ETID (External Transaction ID) for the database connection | No |
-readonly | Read-only mode (no updates) | No |
Filtering, ordering and data selection
| Parameter | Description | Required |
|---|---|---|
-sql | SQL SELECT statement. Supports SELECT, FROM, WHERE, JOIN (INNER, LEFT, RIGHT, FULL), ORDER BY, GROUP BY, LIMIT, OFFSET, DISTINCT | No |
-search | Adabas-syntax search, by short (AA) or DDM name. Supports =, ranges [a:b], and/or | No |
-sortby | Descriptor/superdescriptor for logical-order reads (short or DDM name) | No |
-fromisn | Starting ISN for sequence reads | No |
-toisn | Ending ISN for sequence reads | No |
-isnq | Reads a single ISN and exits (error when missing). Mutually exclusive with -search, -sql, -sortby, -fromisn and -toisn | No |
-fields | Fields to extract. Accepts short or DDM names; MU (AO[1], AO[1,5]) and PE (AU[1], AV[1,1]) notation. Extracts all if omitted | No |
-limit | Limits the number of extracted records | No |
-partialread | Enables partial read mode | No |
Output format and destination
| Parameter | Description | Required |
|---|---|---|
-format | Output format: csv, json, xml, tab (alias list), record (alias form, card) (default tab) | No |
-delimiter | CSV delimiter (default ;; for tab format uses tab or a custom delimiter) | No |
-outfile | Output file path (stdout if omitted) | No |
-isn | Includes the ISN in the output | No |
-fdt | Shows the FDT (Field Definition Table) instead of data | No |
-silence | Silent mode (suppresses banner and progress) | No |
Performance
| Parameter | Description | Required |
|---|---|---|
-multifetch | Multifetch size for Adabas reads (default 20) | No |
-blocksize | Block size for Adabas reads (default 65536) | No |
-recordbuffershift | Record buffer shift for Adabas reads (default 100) | No |
Diagnostics, verification and licensing
| Parameter | Description | Required |
|---|---|---|
-check | Checks DDM/FDT consistency: compares the DDM JSON against the Adabas FDT (requires -dbid and -config/-input) | No |
-checkfields | Validates lengths: reads records and reports those exceeding the defined length (DDM from -config or live FDT). Only A/W/G/B; mutually exclusive with -check, -fdt and -sql | No |
-json | Machine-readable JSON report for -check (to stdout or -outfile) | No |
-verbose | Verbose output for -check (shows OK fields) | No |
-debug | Enables detailed logging for diagnostics | No |
-version | Shows version information | No |
-license | Path to the license.key file (default: auto-resolve) | No |
-license-status | Shows detailed license status | No |
-renew-license | Renews the license with a new license.key file | No |
Commented examples
# 1. Basic extraction to stdout in tabular format
nsadafile -dbid 50 -fnr 15 -limit 10
# 2. JSON with selected fields and descriptor search
nsadafile -dbid 50 -fnr 15 -search "AA='CLI001'" -fields "AA,AB,AC" -format json -outfile /tmp/export/cli001.json
# 3. ISN range ordered by descriptor, as XML
nsadafile -dbid 50 -fnr 15 -fromisn 1 -toisn 500 -sortby "AA" -format xml -outfile /tmp/export/range.xml
# 4. SQL query with JOIN and DDM names
nsadafile -dbid 50 -config /tmp/cfg/ddm50.json -sql "SELECT a.AA, b.AB FROM SAMPLE-CUSTOMER a INNER JOIN SAMPLE-ORDERS b ON a.AA=b.AA LIMIT 100" -format csv
# 5. File FDT (structure, no data)
nsadafile -dbid 50 -fnr 15 -fdt
# 6. Large extraction with tuned performance and no progress output
nsadafile -dbid 50 -fnr 15 -multifetch 50 -blocksize 131072 -limit 10000 -format json -silence -outfile /tmp/export/large.json
# 7. A single ISN as a form and as a list
nsadafile -dbid 50 -fnr 15 -isnq 12345 -format form
nsadafile -dbid 50 -fnr 15 -isnq 12345 -fields "AA,AB" -format list
# 8. Validate lengths against the DDM and save violations
nsadafile -dbid 50 -config /tmp/cfg/ddm50.json -ddmname SAMPLE-CUSTOMER -checkfields -outfile /tmp/export/overflows.txt
Return codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Command-line parameter error |
2 | Configuration file error |
3 | Database connection error |
4 | Data extraction error |
FAQ
Do I always need -config? No. Without -config you work directly with -dbid and -fnr and short field names (AA, AB). -config is required with -ddmname, DDM names or -sql; that JSON is generated by nsddm.
Which output format should I choose? csv for spreadsheets and analysis, json for APIs and programmatic processing, xml for enterprise integration, tab (or list) for quick console reads and record (or form) for visual record-by-record inspection. Tune the CSV separator with -delimiter.
How do I view a single record? With -isnq N (e.g. -isnq 12345): it reads only that ISN and exits; a missing ISN returns an error. Combine with -format form for a card view or -format list (with -fields) for a list view. Use -fromisn/-toisn for ranges.
How do I extract only part of a file? Combine -search (by index), -sortby (logical order), -fromisn/-toisn (physical range) and -limit (cap). For large volumes, raise -multifetch and -blocksize.
How do I verify my DDM before migrating? With -check (plus -json for machine output, -verbose to also list OK fields). Requires -dbid and -config/-input. Use -fdt for structure without data and -debug for diagnostics.
How do I find data that does not fit the definition? With -checkfields: it reads the records and lists those exceeding the defined length (ISN, field, defined and real length in bytes/runes). Without -config it compares against the live FDT; with -config/-ddmname, against the DDM. Narrow the scope with -fields, -search, -fromisn/-toisn or -limit, and save the report with -outfile. Exit codes: 0 no overflows, 1 overflows found, 2 error.