# Dynamically generate a ddm structure in a copycode

**URL:** <https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479>\
**Category:** Forum\
**Tags:** Adabas-Natural\
**Created:** [September 7, 2020, 9:48pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479 "2020-09-07T21:48:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ranulfo\_Grajales2](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@Ranulfo\_Grajales2](https://techcommunity.softwareag.com/u/Ranulfo_Grajales2)\
**Post date:** [September 7, 2020, 9:48pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/1 "2020-09-07T21:48:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![wolfgang.winter](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wolfgang.winter/32/17954_2.png) [@wolfgang.winter](https://techcommunity.softwareag.com/u/wolfgang.winter)\
**Post date:** [September 7, 2020, 10:06pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/2 "2020-09-07T22:06:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ranulfo\_Grajales2](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@Ranulfo\_Grajales2](https://techcommunity.softwareag.com/u/Ranulfo_Grajales2)\
**Post date:** [September 7, 2020, 10:57pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/3 "2020-09-07T22:57:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![wolfgang.winter](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wolfgang.winter/32/17954_2.png) [@wolfgang.winter](https://techcommunity.softwareag.com/u/wolfgang.winter)\
**Post date:** [September 7, 2020, 11:28pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/4 "2020-09-07T23:28:39Z")

</div>

If you have PRE-DICT your best bet is to use its API to add the file definition and then trigger a GENERATE DDM.

---

<div class="post-metadata">

**Author:** ![Ranulfo\_Grajales2](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@Ranulfo\_Grajales2](https://techcommunity.softwareag.com/u/Ranulfo_Grajales2)\
**Post date:** [September 9, 2020, 4:59am UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/5 "2020-09-09T04:59:30Z")

</div>

Thanks. Can you give me an example using USR2019N?

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [September 9, 2020, 5:16am UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/6 "2020-09-09T05:16:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [September 9, 2020, 2:20pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/7 "2020-09-09T14:20:54Z")

</div>

Ranulfo,

USR2019N does not read or write DDMs.

---

<div class="post-metadata">

**Author:** ![Ranulfo\_Grajales2](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@Ranulfo\_Grajales2](https://techcommunity.softwareag.com/u/Ranulfo_Grajales2)\
**Post date:** [September 9, 2020, 6:01pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/8 "2020-09-09T18:01:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wolfgang.winter](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wolfgang.winter/32/17954_2.png) [@wolfgang.winter](https://techcommunity.softwareag.com/u/wolfgang.winter)\
**Post date:** [September 9, 2020, 6:05pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/9 "2020-09-09T18:05:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [September 9, 2020, 6:16pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/10 "2020-09-09T18:16:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [September 9, 2020, 7:04pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/11 "2020-09-09T19:04:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:45pm UTC](https://techcommunity.softwareag.com/t/dynamically-generate-a-ddm-structure-in-a-copycode/233479/12 "2021-04-02T15:45:09Z")

</div>


