# Import CSV data into ADABAS

**URL:** <https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, Adabas-Natural-Community-Edition\
**Created:** [May 30, 2011, 4:54pm UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271 "2011-05-30T16:54:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hubert\_Kauker1](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@Hubert\_Kauker1](https://techcommunity.softwareag.com/u/Hubert_Kauker1)\
**Post date:** [May 30, 2011, 4:54pm UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271/1 "2011-05-30T16:54:00Z")

</div>

We have NaturalONE CE 8.2.

In order to play with data from an existing Non-Adabas database, we would like to import a CSV file into an Adabas database file which has been created with suitable field definitions.

Can you give us an example how to do it?

We looked in the DBA Workbench and in the Utilities section of the Adabas docs, but were unable to find any help.

Many thanks.

---

<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:** [June 1, 2011, 6:39am UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271/2 "2011-06-01T06:39:39Z")

</div>

Hi Hubert,

Your best bet is to write a Natural program to load the data. I don’t know of any way to do it using Adabas utilities.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [June 1, 2011, 3:46pm UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271/3 "2011-06-01T15:46:23Z")

</div>

Maybe The ADACMP-Parameter SEPERATOR helps you…

[http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada6110os/utils/cmp.htm#cmpseparator](http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada6110os/utils/cmp.htm#cmpseparator)

---

<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:** [June 2, 2011, 8:23am UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271/4 "2011-06-02T08:23:55Z")

</div>

> [@Matthias](#):
>
> Maybe The ADACMP-Parameter SEPERATOR helps you…
> 
> [http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada6110os/utils/cmp.htm#cmpseparator](http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada6110os/utils/cmp.htm#cmpseparator)

When did that sneak in? :o It’s documented in v6.1 so it must be at least 4 years ago!

This old dog has learnt a new trick today. 🙂

Cheers,  
Graeme

---

<div class="post-metadata">

**Author:** ![Ats](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@Ats](https://techcommunity.softwareag.com/u/Ats)\
**Post date:** [June 6, 2011, 4:00pm UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271/5 "2011-06-06T16:00:09Z")

</div>

Hi (Mate) Graeme 😃 ,

The link points to open system v6.1 doco and the SEPERATOR feature is available there.

Looks like the Mainframe latest verison v8.2.3 still doesn’t support the same.

---

<div class="post-metadata">

**Author:** ![Hubert\_Kauker1](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@Hubert\_Kauker1](https://techcommunity.softwareag.com/u/Hubert_Kauker1)\
**Post date:** [July 20, 2011, 5:58pm UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271/6 "2011-07-20T17:58:50Z")

</div>

Thanks for mentioning the ADACMP tool. It must be used in conjunction with ADAMUP to do the job.  
The documentation is quite hard to read, and a fully worked example would appear to be useful.  
For the benefit of other readers, however, the following \*.bat file shows how it is done.

The call is:  
csv.bat input dbid filenumber [separator]  
When no separator is given, semicolon is assumed.

Just remember to have the Adabas bin directory on your environment PATH variable so that ADACMP and ADAMUP can be found.

Cheers,  
Hubert

```auto
@echo off
cls

rem ***
rem * Import a given csv file into an adabase file.
rem * Syntax: %0 csv-input-file dbid filenumber [separator]
rem ***

set CMPIN=%1
if not "%CMPIN%" == "" goto continue

echo Syntax: %0 csv-input-file dbid filenumber [separator]
goto exit

:continue
if exist %CMPIN% goto begin

echo Input file %CMPIN% not found.
goto exit

:begin

set CMPDTA=csv.dta
set CMPDVT=csv.dvt
set CMPERR=csv.err

if exist %CMPDTA% del %CMPDTA%
if exist %CMPDVT% del %CMPDVT%
if exist %CMPERR% del %CMPERR%

set sep=%4
if "%sep%" == "" set sep=\;

echo adacmp DBID=%2 FILE=%3 SEPARATOR=%sep%
echo.
adacmp DBID=%2 FILE=%3 SEPARATOR=%sep%

if exist csv.err goto error

set MUPDTA=csv.dta
set MUPDVT=csv.dvt
set MUPERR=csv.err

echo.
echo adamup DBID=%2 UPDATE=%3 ADD
echo.
adamup DBID=%2 UPDATE=%3 ADD

if exist csv.err goto error
goto exit

:error
set ERRIN=csv.err
adaerr dump

:exit
```

---

<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:00pm UTC](https://techcommunity.softwareag.com/t/import-csv-data-into-adabas/97271/7 "2021-04-02T15:00:19Z")

</div>


