# importing data from text file to adabas

**URL:** <https://techcommunity.softwareag.com/t/importing-data-from-text-file-to-adabas/185269>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples, Natural-on-Windows-Unix\
**Created:** [November 23, 2015, 8:35pm UTC](https://techcommunity.softwareag.com/t/importing-data-from-text-file-to-adabas/185269 "2015-11-23T20:35:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eman\_aljoumah](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@eman\_aljoumah](https://techcommunity.softwareag.com/u/eman_aljoumah)\
**Post date:** [November 23, 2015, 8:35pm UTC](https://techcommunity.softwareag.com/t/importing-data-from-text-file-to-adabas/185269/1 "2015-11-23T20:35:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brian\_Johnson1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/brian_johnson1/32/163_2.png) [@Brian\_Johnson1](https://techcommunity.softwareag.com/u/Brian_Johnson1)\
**Post date:** [November 23, 2015, 9:27pm UTC](https://techcommunity.softwareag.com/t/importing-data-from-text-file-to-adabas/185269/2 "2015-11-23T21:27:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [November 24, 2015, 2:43am UTC](https://techcommunity.softwareag.com/t/importing-data-from-text-file-to-adabas/185269/3 "2015-11-24T02:43:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:34pm UTC](https://techcommunity.softwareag.com/t/importing-data-from-text-file-to-adabas/185269/4 "2021-04-02T15:34:45Z")

</div>


