← Alle Tools

NSADALoader

Version 26.1 (build 15) PPT ansehen

Diese Dokumentation gibt es noch nicht auf Deutsch: Englisch wird gezeigt.

Inhalt

Commercial deck: PDF (ES) · PPTX (ES) · PDF (EN) · PPTX (EN)

What NSADALoader is

nsadaloader loads data from JSON, CSV, TSV and XML files into Adabas databases. It inserts new records (STORE, no isn field), updates existing ones (UPDATE, with isn field), deletes by ISN (DELETE, single-record mode with -delete) and handles one record per command line (-set/-data) from a single file that can span multiple files and databases. It supports MU fields (arrays), PE groups (arrays of objects) and index notation (FIELD[n], FIELD[n,m]), plus exporting (-output) and template generation (-describe).

Ideal uses:

  • Data migration from external systems into Adabas.
  • Initial master-data loads and automated ETL.
  • Mass updates of records (by ISN or MU/PE indexes).
  • Export, edit and reload (the -output → edit → -input flow).

Dbids, fnrs, field names and data in the examples are fictitious.

Use cases

1. Initial customer load (STORE)

Insert three new customers from a self-contained JSON file.

nsadaloader -input /tmp/load/new_customers.json
{ "dbid": 50, "fnr": 15, "records": [{ "AA": "CLI001", "AB": "EXAMPLE CORP" }] }

2. Mass update by ISN (UPDATE)

Update names and salaries of existing records identified by ISN.

nsadaloader -input /tmp/load/update_salaries.json

3. Multi-file migration in a single pass

Load customers (file 15) and orders with a PE group (file 16) of the same database from one file.

nsadaloader -input /tmp/load/full_migration.json -batch 100

4. CSV load with a DDM schema

Load invoices from CSV with type conversion driven by the DDM (dates, packed fields, PE/MU).

nsadaloader -dbid 50 -fnr 20 -config /tmp/cfg/ddm_invoices.json -input /tmp/load/invoices.csv

5. Export, edit and reload

Export with ISN, fix in an editor and reload: records with isn are updated, without isn are inserted.

nsadaloader -dbid 50 -fnr 15 -output /tmp/load/employees_export.json
nsadaloader -input /tmp/load/employees_export.json

6. Single-record one-liner (INSERT/UPDATE/DELETE)

No -input file: -set k=v,k=v or -data with a JSON object. UPDATE/DELETE target -isn; DELETE additionally requires -delete. Every real operation requires -yes; -dry-run previews without a transaction.

nsadaloader -dbid 50 -fnr 20 -set "AA=CLI001,AB=EXAMPLE CORP" -dry-run
nsadaloader -dbid 50 -fnr 20 -set "AA=CLI001,AB=EXAMPLE CORP" -yes
nsadaloader -dbid 50 -fnr 20 -isn 42 -set "AB=NEW NAME" -yes
nsadaloader -dbid 50 -fnr 20 -isn 42 -delete -yes

Command reference

Loading (STORE/UPDATE)

ParameterDescriptionRequired
-inputInput file with the records (JSON, CSV, TSV or XML)Unless -describe or -output
-dbidAdabas database ID (overrides the file value)Depends on format (yes for legacy/flat)
-fnrAdabas file number (overrides the file value)Depends on format (yes for legacy/flat)
-ddmnameDDM name from the configuration fileDepends on format
-configJSON configuration file with DDM definitions (generated by nsddm)If -ddmname is used (recommended with CSV/TSV/XML)
-formatInput format: json, csv, tsv or xml (default: detected from the extension)No
-batchRecords per transaction (default 100; 0 = single transaction)No

Single record without -input (INSERT/UPDATE/DELETE)

ParameterDescriptionRequired
-setRecord fields k=v,k=v (MU: AG=a;b or AG[1]=a; PE: AE[1].AF=x). Alternative to -dataYes, without -data (except DELETE)
-dataRecord fields as a JSON object '{"AA":"x","AG":["a","b"]}'. Alternative to -setYes, without -set (except DELETE)
-isnTarget ISN of the single-record UPDATE/DELETEIn UPDATE/DELETE
-deleteDeletes one record by -isn (no -set/-data)In DELETE
-yesConfirms single-record INSERT/UPDATE/DELETE (required unless -dry-run)In real operation
-dry-runPreviews without executing a transactionNo

Export

ParameterDescriptionRequired
-outputOutput JSON file to export records from Adabas (compatible with -input)When exporting
-limitMaximum records to export (0 = no limit)No

Templates and reads (-describe)

ParameterDescriptionRequired
-describeDescribes the file structure and generates an editable JSON template (read-only connection)No
-isnISN to read, only with -describe (template with real data)No

Common and licensing

ParameterDescriptionRequired
-silenceSilent modeNo
-debugDetailed loggingNo
-etidExternal Transaction ID (ETID)No
-versionShows version informationNo
-licensePath to the signed license.key file (default: automatic resolution)No
-license-fingerprintPrints this machine’s license fingerprint and exitsNo

Commented examples

# 1. Basic self-contained load (STORE without isn / UPDATE with isn)
nsadaloader -input /tmp/load/basic_load.json

# 2. One transaction every 50 records (recommended for large loads)
nsadaloader -input /tmp/load/batch_50000.json -batch 50

# 3. Empty template, edit and load (the -describe flow)
nsadaloader -dbid 50 -fnr 15 -describe > /tmp/load/template.json
nsadaloader -input /tmp/load/template.json

# 4. Read a real record as a template (ISN 42) and export a sample
nsadaloader -dbid 50 -fnr 15 -describe -isn 42 > /tmp/load/record42.json
nsadaloader -dbid 50 -fnr 16 -output /tmp/load/sample.json -limit 50

# 5. CSV load with DDM and flat XML load with CLI flags
nsadaloader -dbid 50 -fnr 20 -config /tmp/cfg/ddm_invoices.json -input /tmp/load/invoices.csv
nsadaloader -dbid 50 -fnr 20 -config /tmp/cfg/ddm_invoices.json -input /tmp/load/invoices_flat.xml

# 6. Machine fingerprint and load with an explicit license
nsadaloader -license-fingerprint
nsadaloader -license /opt/ns/licenses/nsadaloader.key -input /tmp/load/records.json

# 7. Single-record one-liner: preview, insert, update and delete
nsadaloader -dbid 50 -fnr 20 -set "AA=CLI001,AB=EXAMPLE CORP" -dry-run
nsadaloader -dbid 50 -fnr 20 -set "AA=CLI001,AB=EXAMPLE CORP" -yes
nsadaloader -dbid 50 -fnr 20 -isn 42 -set "AB=NEW NAME" -yes
nsadaloader -dbid 50 -fnr 20 -isn 42 -delete -yes

Return codes

CodeMeaning
0Success
1Parameter error
2Configuration or input file error
3Connection error
4Error during load

An invalid license (wrong app, different machine, expired or corrupt) blocks execution with a non-zero exit code.

FAQ

How does it tell STORE from UPDATE? By the isn field: without isn it inserts (Adabas assigns a new ISN); with isn it updates that record. In CSV/TSV/XML the isn column or element matches the JSON field. To duplicate exported records, remove the isn.

How do I delete a record? Only in single-record mode: nsadaloader -dbid 50 -fnr 20 -isn 42 -delete -yes (or -dry-run to preview). There is no file-based mass delete in this version; export first with -output as a backup.

-set or -data? -set "AA=x,AB=y" for simple cases (MU with ;, PE with AE[1].AF=x); -data '{"AA":"x","AG":["a","b"]}' for complex MU/PE. They are mutually exclusive and both accept DDM names with -config.

Do I need -config? Only with -ddmname or DDM names in the data. Without -config, the file must use short names (AA, AB). With CSV/TSV/XML, -config is recommended so dates, packed and numeric values convert per each field’s real type.

How do I load MU and PE fields? MU as arrays ("AG": ["a@x.com", "b@x.com"]), PE as arrays of objects ("AD": [{"AE": "...", "AF": "..."}]). To update single occurrences use 1-based indexes: AG[2], AE[1], AJ[1,2] (PE n, MU m). In CSV the notation is BC[1], AE[1].AF, AQ[1].AU[2]; in XML, repeated elements.

Which -batch size should I use? The default (100) fits most cases; above 10,000 records use 50–500. With -batch 0 everything goes in one transaction (faster but riskier on failure). If one record fails, the utility continues with the next.

Auch verfügbar in: es