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?
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 ]
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.
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?
‘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 ?
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.
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.
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.