# unload Data using ADACMP

**URL:** <https://techcommunity.softwareag.com/t/unload-data-using-adacmp/57782>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Linux, Adabas-Utilities-on-Open-Systems\
**Created:** [September 19, 2005, 6:18pm UTC](https://techcommunity.softwareag.com/t/unload-data-using-adacmp/57782 "2005-09-19T18:18:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarovb](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sarovb](https://techcommunity.softwareag.com/u/sarovb)\
**Post date:** [September 19, 2005, 6:18pm UTC](https://techcommunity.softwareag.com/t/unload-data-using-adacmp/57782/1 "2005-09-19T18:18:10Z")

</div>

HI  
How can I unload the data to flat file using ADACMP with delimiter ( | or % or # ).

any examples. … or steps

Sarov

---

<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:** [September 19, 2005, 8:20pm UTC](https://techcommunity.softwareag.com/t/unload-data-using-adacmp/57782/2 "2005-09-19T20:20:21Z")

</div>

> [@sarovb](#):
>
> How can I unload the data to flat file using ADACMP with delimiter ( | or % or # ).

The best way would be to use NATURAL. There you got no problems with packed or unpacked formats, time- or date-fields, multiple fields, etc.

If you are forced to do it without natural, you have to write a converter. This can be really time-consuming:

1. use ADAULD to unload data
2. use ADADCU to uncompress data
3. write a converter, which converts uncompressed data to ascii (but in consideration of the FDT)

---

<div class="post-metadata">

**Author:** ![sarovb](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sarovb](https://techcommunity.softwareag.com/u/sarovb)\
**Post date:** [September 19, 2005, 11:05pm UTC](https://techcommunity.softwareag.com/t/unload-data-using-adacmp/57782/3 "2005-09-19T23:05:54Z")

</div>

hi  
do you have any sample natural programs for unloading data?

any help would be appreicated

sarov

---

<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:** [September 20, 2005, 1:42pm UTC](https://techcommunity.softwareag.com/t/unload-data-using-adacmp/57782/4 "2005-09-20T13:42:27Z")

</div>

> [@sarovb](#):
>
> hi  
> do you have any sample natural programs for unloading data?

You have to be careful with writing Numeric fields directly to a workfile. It is better to do a move edited before. So the signs of the numbers are translated correctly. Alphanumeric fields are no problem…

```auto
define data local
01 file1 view of ddm_name
02 AA (A10) /* A10 on database
02 AB (P5.2) /* P4 on database
02 AC (N4) /* U4 on database
*
01 #delimiter (A1) CONST <';'>
01 #converted_p (A9)
01 #converted_u (A5)
end-define
*
define work file 1 '/tmp/test.txt'
read file1
  move edited AB (EM=+99999.99) to #converted_p
  move edited AC (EM=+9999) to #converted_u
  write work file 1
    AA #delimiter
    #converted_p #delimiter
    #converted_u #delimiter
end-read
close work file 1
end
```

---

<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, 2:38pm UTC](https://techcommunity.softwareag.com/t/unload-data-using-adacmp/57782/5 "2021-04-02T14:38:52Z")

</div>


