One Natural environment, four ADABAS databases

This is “Can I do this?” I have an application that manages Natural objects. I have four databases. I want to move these objects between these databases. There is a process for this movement that I will not go into. I can perform the Natural functions within one database. Once I attempt to switch to another database, I get NAT9988 error. Can I do this with a single Natural address space?

A Natural environment is defined by a Natural code repository (FNAT), a dictionary repository (FDIC), and a source code repository (FUSER). If you have four source code repositories (FUSERs), then you have four Natural environments, not one.

Movement of modules between repositories is handled by Natural utilities SYSMAIN and SysObjH.

Thanks. That’s very interesting. Without going off into the weeds, let’s say I have an application that masks the Natural/ADABAS environment. How, from that application, can I switch between environments. I have such an application working with a single Natural/ADABAS pair. I want to work with objects in one pair and then move those objects to another pair.

If your DDM’s have DBID=0, then you can use the UDB parameter to toggle between the databases you are using.

If the DBID is not 0, you will need to use the TF (translate file) facility to switch from the default database and file number to the new dbid/fnr.

Check out the SYSEXT library for APIs to make these switches (UDB or TF) under programmatic control.