← All utilities

NSAdaFile

Version 26.1 (build 312) 30-day trial
Contents

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, -debug modes).

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

ParameterDescriptionRequired
-dbidAdabas database IDYes
-fnrAdabas file number to extractIf -ddmname not used
-ddmnameDDM name (logical file name from the JSON config). Overrides fnr when config is providedIf -fnr not used
-configJSON configuration file with schema definitionsIf -ddmname is used
-inputAlias for -config (DDM JSON file, e.g. ddm50.json)No
-etidETID (External Transaction ID) for the database connectionNo
-readonlyRead-only mode (no updates)No

Filtering, ordering and data selection

ParameterDescriptionRequired
-sqlSQL SELECT statement. Supports SELECT, FROM, WHERE, JOIN (INNER, LEFT, RIGHT, FULL), ORDER BY, GROUP BY, LIMIT, OFFSET, DISTINCTNo
-searchAdabas-syntax search, by short (AA) or DDM name. Supports =, ranges [a:b], and/orNo
-sortbyDescriptor/superdescriptor for logical-order reads (short or DDM name)No
-fromisnStarting ISN for sequence readsNo
-toisnEnding ISN for sequence readsNo
-fieldsFields to extract. Accepts short or DDM names; MU (AO[1], AO[1,5]) and PE (AU[1], AV[1,1]) notation. Extracts all if omittedNo
-limitLimits the number of extracted recordsNo
-partialreadEnables partial read modeNo

Output format and destination

ParameterDescriptionRequired
-formatOutput format: csv, json, xml, tab, record (default tab)No
-delimiterCSV delimiter (default ;; for tab format uses tab or a custom delimiter)No
-outfileOutput file path (stdout if omitted)No
-isnIncludes the ISN in the outputNo
-fdtShows the FDT (Field Definition Table) instead of dataNo
-silenceSilent mode (suppresses banner and progress)No

Performance

ParameterDescriptionRequired
-multifetchMultifetch size for Adabas reads (default 20)No
-blocksizeBlock size for Adabas reads (default 65536)No
-recordbuffershiftRecord buffer shift for Adabas reads (default 100)No

Diagnostics, verification and licensing

ParameterDescriptionRequired
-checkChecks DDM/FDT consistency: compares the DDM JSON against the Adabas FDT (requires -dbid and -config/-input)No
-jsonMachine-readable JSON report for -check (to stdout or -outfile)No
-verboseVerbose output for -check (shows OK fields)No
-debugEnables detailed logging for diagnosticsNo
-versionShows version informationNo
-licensePath to the license.key file (default: auto-resolve)No
-license-statusShows detailed license statusNo
-renew-licenseRenews the license with a new license.key fileNo

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

CodeMeaning
0Success
1Command-line parameter error
2Configuration file error
3Database connection error
4Data 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.

Also available in: es