# Formatted unload using ADABAS utilities

**URL:** <https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Mainframes, Adabas-Basics-on-Mainframes\
**Created:** [July 18, 2012, 6:17am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995 "2012-07-18T06:17:33Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![srij\_p](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@srij\_p](https://techcommunity.softwareag.com/u/srij_p)\
**Post date:** [July 18, 2012, 6:17am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/1 "2012-07-18T06:17:33Z")

</div>

I have been using ADAUTIL and ADAULD for unloading Adabas files. Now, I want to pad ‘Low-values’ in the spaces where MU/PE (occurence) fields are not filled up to its maximum limit.

For example:  
Say, maximum occurence is 5 for a field, say, AA. And, the actual number of times, AA field-value occurs is 3, like AA1AA2AA3. Now, i want to pad ‘low-values’ for remaining (5-3) = 2 occurences. i.e, I want it in the format AA1AA2AA3000000  
(i.e, X’000’ for every remaining occurence)

Is there any way of unloading the files in this fixed-length format?

---

<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:** [July 18, 2012, 9:20am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/2 "2012-07-18T09:20:40Z")

</div>

Yes, check the&nbsp;&nbsp;&nbsp;FORMAT option of ADACMP DECOMPRESS

---

<div class="post-metadata">

**Author:** ![srij\_p](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@srij\_p](https://techcommunity.softwareag.com/u/srij_p)\
**Post date:** [July 19, 2012, 6:20am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/3 "2012-07-19T06:20:53Z")

</div>

Well, I have used the following code-snippet.

ADACMP DECOMPRESS INFILE=‘fle\_name’  
ADACMP FORMAT=AAC,AA1-5

Here, AA is the field-literal. And 5 is the maximum number of occurence possible.  
This is giving me the actual occurence number of AA in every record, followed by the field-values and then padded with space. i.e, suppose, if AA occurs 3 times in a particular record, then the repeating field occurs thrice, and the remaining two spaces are padded with space-value.  
So, the data looks like  
AA1AA2AA3------ [— denotes ‘space’, say]

But I need the data to look like,  
AA1AA2AA3000000

Do you know any way around ?

Thanks,  
Srij

---

<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:** [July 19, 2012, 8:57am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/4 "2012-07-19T08:57:28Z")

</div>

Sorry, but what is your exact problem, the fact that the uncompressed record contains  
spaces rather than 0x00 ?

Well, Adabas will insert a valid “initial value” for the field type in question, and for  
A-type fields this will be spaces, not binary zeroes.

---

<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:** [July 19, 2012, 6:20pm UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/5 "2012-07-19T18:20:01Z")

</div>

What Srij wants doesn’t make sense to me, but if he needs to fill an alpha field with binary zeros …

I haven’t tried this, but perhaps Adabas will accept it.

AA1-5,len,B

Specifying format B should fill empty occurrences with X’00’. If field values always have at least “len” characters, this will work. The problem is, if the field contents are variable in length, Adabas will pad with binary zeros.

---

<div class="post-metadata">

**Author:** ![srij\_p](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@srij\_p](https://techcommunity.softwareag.com/u/srij_p)\
**Post date:** [July 20, 2012, 6:11am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/6 "2012-07-20T06:11:57Z")

</div>

Winter,  
Correct. But my requirement is to format the fields in a manner that it contains some default values, other than spaces. It can suffice the requirement even if the default value is not binary zeroes.  
Is there any way to pad some default other than spaces??

Ralph,  
I tried what you suggested. But the field contents are variable in length and its not working. Just to verify, ‘len’ is the length of the field, right? Is there any way to pad any other values than binary zeroes?

---

<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:** [July 23, 2012, 9:18am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/7 "2012-07-23T09:18:16Z")

</div>

‘len’ is the length of the data as it will appear on the output file, Adabas will pad  
all fields to that length and you should NOT see variable length data.

And no, there is no way of using something other than the default value “native” to  
the data type, and I still don’t see the reason for padding data with an arbitrary  
“default value”, you know the data type, you know what the padding character  
is, so what difference does it make whether a field is padded with 0x20 or 0x37,  
for example ?

---

<div class="post-metadata">

**Author:** ![srij\_p](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@srij\_p](https://techcommunity.softwareag.com/u/srij_p)\
**Post date:** [July 24, 2012, 1:26pm UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/8 "2012-07-24T13:26:54Z")

</div>

Well, the problem solved! 🙂  
Actually, I wanted to pad zeroes to the numeric fields and the above code snippet worked.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [July 25, 2012, 12:43pm UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/9 "2012-07-25T12:43:52Z")

</div>

What is it you are trying to do?

Is whatever you are trying to do worth the potentially huge increase in CPU time?

You do realize that if the maximum number of occurrences for, say, an MU field is fifty, and you fill every record with fifty occurrences, you are forcing Adabas, when called upon to read a record, to “strip” fifty occurrences from every record, then move fifty occurrences to the record buffer, then Natural has to move fifty occurrences from the record buffer to the View fields.

By contrast, if say 95% of the records have eight occurrences or less, you could read every record into a view with eight occurrences, and also have c\* in the view to tell you if you need to access the remaining occurrences.

By forcing every repeating field to have a count equal to the maximum number of occurrences, you negate a major feature of Adabas, namely the ability to have Adabas do the bookkeeping for however many occurrences as actually exist. Its about the same as having all your fields defined as FI even though they might vary from three to two hundred bytes in length.

steve

---

<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:** [July 25, 2012, 1:10pm UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/10 "2012-07-25T13:10:10Z")

</div>

I assume the whole story is about “move Adabas data to … elsewhere”,  
otherwise none of this makes any sense at all.

---

<div class="post-metadata">

**Author:** ![srij\_p](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@srij\_p](https://techcommunity.softwareag.com/u/srij_p)\
**Post date:** [July 26, 2012, 7:02am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/11 "2012-07-26T07:02:33Z")

</div>

Yes. The assumption is correct. And the occurences we are dealing with are not as huge as 50. 🙂

---

<div class="post-metadata">

**Author:** ![anon72918622](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@anon72918622](https://techcommunity.softwareag.com/u/anon72918622)\
**Post date:** [July 27, 2012, 11:58am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/12 "2012-07-27T11:58:22Z")

</div>

Hi Srij,

Depending on what you really want to do there are easier ways of doing it e.g. replication.

Regards,  
Wolfgang

---

<div class="post-metadata">

**Author:** ![custom55](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@custom55](https://techcommunity.softwareag.com/u/custom55)\
**Post date:** [July 27, 2012, 10:17pm UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/13 "2012-07-27T22:17:23Z")

</div>

> [@Wolfgang Weiss](#):
>
> Hi Srij,
> 
> Depending on what you really want to do there are easier ways of doing it e.g. replication.
> 
> Regards,  
> Wolfgang

Yes, we’ve been using ADABAS replication ( mainframe to Oracle ) for three years now and I have nothing but great things to say about it.

Solid product.

---

<div class="post-metadata">

**Author:** ![Ananya\_Agrawal](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Ananya\_Agrawal](https://techcommunity.softwareag.com/u/Ananya_Agrawal)\
**Post date:** [November 25, 2013, 10:02am UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/14 "2013-11-25T10:02:14Z")

</div>

Hi Srij,

I am new to ADABAS and my current requiremnet is migrating the data from ADABAS to Oracle. I saw your post, can you please share “ADAUTIL and ADAULD utility(with parameters) and their sample unloaded data” for unloading Adabas files.

Thanks in Advance.

---

<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:** [December 2, 2013, 4:20pm UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/15 "2013-12-02T16:20:24Z")

</div>

Guess the best way to migrate Adabas to Oracle is to make Adabas as inefficient as possible so Oracle looks like a dream?

In all my experiences in replicating data from Adabas to Oracle, I have never had to fill the data values with anything. We’re long-time tRelational/DPS users and newly also DPSync. I am quite confident those products also don’t fill in leading zeroes, trailing blanks when sending data to be processed by SQL\*Loader or SQL statements. I’d be concerned what Oracle is doing with these x’00’ values on its 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, 3:02pm UTC](https://techcommunity.softwareag.com/t/formatted-unload-using-adabas-utilities/100995/16 "2021-04-02T15:02:10Z")

</div>


