# Are LDAs/PDAs a kind of copycode?

**URL:** <https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [January 25, 2007, 7:36pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881 "2007-01-25T19:36:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 25, 2007, 7:36pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/1 "2007-01-25T19:36:02Z")

</div>

Hello all!

I found out that a catalogued program doesn’t need the referenced LDAs. So my maybe stupid question is: Are LDAs and PDAs a kind of copycode?

Try the following:

1. Create an LDA containing only one field: #test (A10)
2. stow the LDA
3. create a program with the following code and stow it:

```auto
define data local using tst-lda
end-define
#test := 'a'
write #test
end
```

1. delete the LDA
2. execute the Program

---

<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:** [January 25, 2007, 9:42pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/2 "2007-01-25T21:42:49Z")

</div>

External data areas are similar to copycode in that they are incorporated into the object at comple time and are not referenced at execution time.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 26, 2007, 2:13pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/3 "2007-01-26T14:13:20Z")

</div>

> [@Ralph Zbrog](#):
>
> External data areas are similar to copycode in that they are incorporated into the object at comple time and are not referenced at execution time.

You’re right. I forget to mention DDMs.  
Where can I read something about this logic in the documentation? The Programming Guide says:

> [@](#):
>
> A local data area is initialized when a program, subprogram or external subroutine that uses this local data area starts to execute.  
> […] and the DEFINE DATA statement only contains a reference to that data area.

I think this paragraph describes the logical point of view, not the technical one…

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [January 28, 2007, 4:22am UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/4 "2007-01-28T04:22:59Z")

</div>

First, where did the comment about DDMs come from? And what does it have to do with the discussion? 🙂

Next, I will check in the Programming Guide latter, but I believe all the excerpt you posted is saying is that Variables in an LDA (whether internal or external) are initialized at the time the “object” is about to be executed, which of course is true.

steve

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 29, 2007, 2:02pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/5 "2007-01-29T14:02:12Z")

</div>

> [@Steve Robinson](#):
>
> First, where did the comment about DDMs come from? And what does it have to do with the discussion? 🙂

It was me!  
DDM are also “incorporated into the object at compile time”.

> [@Steve Robinson](#):
>
> but I believe all the excerpt you posted is saying is that Variables in an LDA (whether internal or external) are initialized at the time the “object” is about to be executed, which of course is true.

I think you’re right. But where in the documentation can I read anything about my initial question?

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [January 30, 2007, 4:02am UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/6 "2007-01-30T04:02:52Z")

</div>

Hi Matthias;

I wandered through the documentation and did not even find your quote (are you sure it was in the programming guide?).

However, it is all very straight forward. An external LDA does not appear in your source code. However, when you STOW an object with an external LDA, the resultant “stuff” (definitions, edit masks, INITs etc) appears in the object code. Thus, once it is STOW’ed, you no longer need the source definition.

steve

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 30, 2007, 1:20pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/7 "2007-01-30T13:20:00Z")

</div>

Hello Steve!

You can find my quote here:  
[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat622win/pg/pg\_obj\_darea\_0035.htm#Local\_Data\_Area](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat622win/pg/pg_obj_darea_0035.htm#Local_Data_Area)

> [@Steve Robinson](#):
>
> An external LDA does not appear in your source code.

I thought my TST-LDA is an “external LDA” :?: :?:

> [@](#):
>
> However, when you STOW an object with an external LDA, the resultant “stuff” (definitions, edit masks, INITs etc) appears in the object code. Thus, once it is STOW’ed, you no longer need the source definition.

If I understand you correctly, I don’t the the source definition of the LDA at runtime. I even don’t need the object code of the LDA. The only thing I need is the object code of the program.

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [January 30, 2007, 9:29pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/8 "2007-01-30T21:29:33Z")

</div>

Matthias,

external LDA/PDA are similar to Copycode.

LOCAL USING LDA is a shorthand for  
LOCAL  
1 blabla  
…  
and enables reusage of data definitions and initializations.

A saved only data area can not be included into the program. It must be stowed. What does it mean to stow a data area? In early versions of Natural for Unix the STOW did the following:

1. Syntax check the “comments” in the source code (comments are the parts of the source code the editor works on)
2. Add a DEFINE DATA LOCAL/PARAMETER statement to the source code defining all the data
3. Save the modified source code, no compiled object!
4. Mark the object as “compiled” in the filedir.sag.  
If you then saved the object again, the DEFINE DATA got lost, but the compile flag did not. At compile time, the compiler complained about an empty object.

Today a compiled object is created in Unix, too. This compiled object does also contain nothing else but a DEFINE DATA, but I think, not in a human readable format (can’t check now).

The only data area that behaves like a “program” is the GDA. A GDA is not incorporated into the object code of the using program, but only a reference to it. That’s the reason, why a GDA must be available at runtime.

hth

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [January 30, 2007, 9:37pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/9 "2007-01-30T21:37:57Z")

</div>

Hi Matthias;

Sorry. I re-read what I wrote and realize the confusion. When I said “your” I was not referring to your code. Also, in the next two sentences, “you” does not mean you, Matthias.

I was writing as if you/your referred to any programmer.

steve

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 31, 2007, 1:47pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/10 "2007-01-31T13:47:53Z")

</div>

[quote="Wilfried B

---

<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, 2:41pm UTC](https://techcommunity.softwareag.com/t/are-ldas-pdas-a-kind-of-copycode/61881/11 "2021-04-02T14:41:01Z")

</div>


