I am working in Natural/adabas in windows based version
How to insert a new record in adabas table . Is there any direct option available in adabas to load the data in a table(Please provide some example) or do I need to write program for each new row insertion. Please let me know
I find load option available in the windows based version and tried this and it failed.
Please could you let me know the process for ADACompress and ADAload in windows based adabas. I tried the same, but its confusing.Could you pls help me
If you choose this way, you have to do the following steps:
Prepare a file containing the records you want to import.
Use ADACMP to convert the file to compressed format.
Use ADAMUP to import it to the database.
Let’s say you got a very simple ADABAS file (database 1, file 10) with the following record structure:
Field Definition Table:
Level I Name I Length I Format I Options I Flags
-------------------------------------------------------------
1 I AA I 1 I A I I
1 I AB I 7 I U I DE I
1 I AC I 3 I U I NU I
Prepare a file with the folloing content:
A;1234567;001;
B;7654321;002;
Z;0012121;003;
Next step is to run the utilities. In the LINUX-World it would look like the following:
export CMPDTA=/path/file.txt # name input file
export CMPDTA=/path/file_compressed.dat # name output file
adacmp db=1 file=10 single_file separator=';'
export MUPDTA=/path/file_compressed.dat # name input file
adamup db=1 add=10 update
In the DBA-Workbench you have to click a little bit more. But you’re able to set the path to the files and the options (SINGLE_FILE or UPDATE) like I did.
Please note, that you can get problems if your separator occur in the field-data, too. If you want to be on the save side, you can use the Adabas compressed format for your input file as well. But that’s another story…
Each record is preceded by a 2-byte-integer-counter which indicates the length of the following record. In my example, each uncompressed record has a length of 11 byte (1+7+3). So the value of this counter is always “0B 00”.
This means: The records are not separated by newline or any other character.
To keep it simple, the fields should be in the sequence as they are in the FDT.
You don’t have to care about the field-options DE and NU
If you got packed numbers in your record structure, you have to write the regarding values in your file
Each periodic group or multiple field is preceded by a 1-byte-integer-counter containting the occurance. If you got varying occurences, you’ll get different record lengths. This is why the records must have a “record-length counter” at the beginning.