← Todas as utilidades

NSAdaFile

Versão 26.1 (build 313) Ver a PPT

Esta documentação ainda não existe em português: a mostrar inglês.

Índice

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, -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

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

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
-isnqReads a single ISN and exits (error when missing). Mutually exclusive with -search, -sql, -sortby, -fromisn and -toisnNo
-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 (alias list), record (alias form, card) (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
-checkfieldsValidates 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 -sqlNo
-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

# 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

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 (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.

Também disponível em: es