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,-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
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
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 |
-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, record (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 |
-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
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 for quick console reads and record for visual record-by-record inspection. Tune the CSV separator with -delimiter.
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.