Changing Data Field Type

Hallo all!

We are using Adabas 3.1. The system is running fine, and the only thing we need to know is how to change one Data Field from Numeric to Alpha-Numeric via the Adabas command-line.

Regards,

Christian Becker

As the compression and storage is different for numeric data than alphanumeric data, you cannot just change the field format (unlike changing lengths). You will have to unload/decompress, modify fdt, compress/load to change it.

Douglas Kelly is right!
I would do the following steps:

  1. Make a backup to be save(ADABCK)
  2. Add a field with the wanted format as a new field.
  3. Write a Program which copies the Data from the old field to the new field
  4. Unload the file (ADAULD)
  5. Decompress the file (ADADCU)
  6. Delete the file
  7. Create the file without the old field
  8. Compress the file (ADACMP) and skip the old field
  9. Load the file (ADAMUP)

Hope this helps …

Hallo,

Thank you for your help. I’m a total newbie to ADABAS and I don’t know how to Unload, Uncompress, Change FDT, Compress and Load the Field. I would appreciate if you could give me hint how the Code for this looks, or maybe you know a good source for detailed information.

Regards,

Please have a look to the ADABAS Manual. I got the standard HTML-Manual which contains detailed descriptions for several ADABAS-Utililities (…\utils\over.htm). The names of the Utilities are always starting with ADA…
e.g
ADABCK → ADAbas BaCKup (Backup or Restore a Database)
ADADBM → ADAbas DataBase Management (add fields, delete files, etc.)
ADAFDU → ADAbas File Definition Utility (create files)
ADAULD → ADAbas UnLoaD
ADADCU → ADAbas DeCompression Utility(Decompress ADAULD-Output)
ADACMP → ADAbas CoMPression (Compress ADADCU-Output)
ADAMUP → ADAbas Mas s UPdate (Load ADACMP-Output into Database)

You can also use the DBA Workbench - select your database, double-click on it, which brings up a list of files and sets the menu bar to the File menus, which include the utilities you need to do this field format change. Start the utility and click on the Help button at the bottom of the dialog.

In case you don’t mind a “dead” field you can just add a new one (ADADBM ADD_FIELDS), move all data to that new field, change all references in your programs accordingly. The superflouous field can then be deleted with a scheduled reorg or the like.

Be aware that “change all references in your programs accordingly” means changing the DDM to reflect the new field name (2 character name) and re-stowing all your Natural programs that use that view/field.

Plus changing all regarding arithmetic statements …