I need to dynamically generate the structure of a ddm in a copycode, this is given the fact of knowing the structure of the ddm, I need to generate it in a program. It’s possible?
You want to generate a DDM and catalog it ?
There is no defined interface for this, I’m afraid.
If you want to generate a VIEW of a DDM into a copycode, this is possible via interface program USR2019N in SYSEXT.
Thanks for your help, but the idea is that I can get the structure of the ddm from a medium external to Natural and what is required is to generate and catalog it as ddm. Is it possible?
If you have PRE-DICT your best bet is to use its API to add the file definition and then trigger a GENERATE DDM.
Thanks. Can you give me an example using USR2019N?
Logon to application library SYSEXT. It includes sample programs to call any API there, including USR2019N.
What are you actually trying to do? You are asking to generate a DDM for something but based on “a medium external to Natural”. A DDM is an interface specific to Natural. So what is your external medium and what type of database does it represent? You are also asking to generate a copycode from the DDM - what is the copycode to be used for, what will the program that uses the copycode be accessing?
USR2019N does not read or write DDMs.
When I mention a medium external to Natural, I mean that I receive the structure in a text file from external application . I want to convert this text file to a copycode or a ddm. I am currently working with Natural v6.3.1 on a Unix operating system. Thanks
Copycode and DDM are two VERY different entities !
As I said, when you have PRE-DICT available, then you can use their APIs to
create the Adabas File description, then trigger a GENERATE DDM on this file.
You can import a DDM into a Copycode to get a VIEW of it, but a Copycode can never hold a DDM.
Again, what are you trying to do - are using Natural to access an Adabas database? A different database that can be accessed from Natural? if so, a copycode isn’t going to help you much. Are you trying to access a flat file? If so, a DDM isn’t going to work.
If the external application is Natural, then request the DDMs in Object Handler format (a special text format) for loading onto the Unix system via the SYSOBJH utility.
If the external application is being ported to Natural, then all I can suggest, other than creating the DDMs manually, is to convert your text file to ObjH format for load via the SYSOBJH utility, but this would require quite a bit of knowledge of the Object Handler utility and its file format.