importing data from text file to adabas

hello softwareag team,

i want to ask how can i import data from a text file to the adabas because i just download the natural adabas package for windows and i want to create my own database and i have it in a text file because it contain large number of records

regards,
eman

Since you are using Natural, the approach I would recommend is to write a Natural program that reads your text file as a work file and then stores the data to Adabas.

Example:

DEFINE DATA LOCAL
1 #IN-RECORD(A253)
1 REDEFINE #IN-RECORD
2 #IN-FIELD-A(A14)
2 #IN-FIELD-B(A7)

1 MYFILE VIEW OF MYDDM
2 FIELD-A
2 FIELD-B

END-DEFINE
*
READ WORK 2 #IN-RECORD
MOVE #IN-FIELD-A TO FIELD-A
MOVE #IN-FIELD-B TO FIELD-B

STORE IN MYFILE
END TRANSACTION
END-WORK
END

This simple approach works well if your data is in a fixed length format. Delimited data would be a little more complicated but not impossible.

There are utilities that can be used by a DBA to load the data into Adabas directly as well that is more efficient.

Both Natural and Adabas can process a CSV as input.

For Natural, use

  • DEFINE WORK FILE n ‘filename’ TYPE “CSV”

For ADACMP, specify the delimiter

  • SEPARATOR=|