# Hi all, I have a problem with this Natural code:

**URL:** <https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [February 2, 2012, 3:20pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626 "2012-02-02T15:20:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teodoro\_Sibelo](https://avatars.discourse-cdn.com/v4/letter/t/f04885/32.png) [@Teodoro\_Sibelo](https://techcommunity.softwareag.com/u/Teodoro_Sibelo)\
**Post date:** [February 2, 2012, 3:20pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626/1 "2012-02-02T15:20:34Z")

</div>

Hi all, I have a problem with this Natural code:

0010 DEFINE DATA LOCAL  
0030 1 TAB (/LIM)  
0040 2 ALFA (A10)  
0050 2 NUM (N3)  
0060 END-DEFINE  
0070 INPUT ALFA(_) NUM(_)  
0080 WRITE ALFA(_) NUM(_)  
0090 END

In Natural V Unis Solaris 6.2.3, checks and uses occurrence one when I RUN it.  
Of course declaring LIM as a constant the problem is solved but it took me a while to locate the error.  
The same program on Windows XP V 6.3.5 PL0 Natural Studio (Rev.: 16 532) does not check.  
I’d appreciate any help.  
Best Regards  
Teo Sibelo

---

<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:** [February 2, 2012, 3:40pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626/2 "2012-02-02T15:40:01Z")

</div>

Hello Teodoro,

Your code is not compilable on Nat 6.3.9PL0@Solaris.

```auto
DEFINE DATA LOCAL
1 TAB (/LIM) /* <-- NAT0280 Index entry incorrectly specified for field.
2 ALFA (A10)
2 NUM (N3)
END-DEFINE
INPUT ALFA(*) NUM(*)
WRITE ALFA(*) NUM(*)
END
```

> [@](#):
>
> In Natural V Unis Solaris 6.2.3, checks and uses occurrence one when I RUN it.

That’s strange :shock:

Matthias

---

<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:** [February 2, 2012, 3:48pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626/3 "2012-02-02T15:48:42Z")

</div>

You can replace LIM with a literal or a named constant.

```auto
DEFINE DATA LOCAL  
1 LIM (I4) CONST <1> /* named constant
1 TAB (/LIM) 
2 ALFA (A10)  
2 NUM (N3)  
END-DEFINE  
INPUT ALFA(*) NUM(*)  
WRITE ALFA(*) NUM(*)  
END 
```

---

<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:** [February 2, 2012, 3:52pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626/4 "2012-02-02T15:52:32Z")

</div>

I got an old NAT6.1@WinXP. Your code is running there. :!:

Here’s my try:

```auto
DEFINE DATA LOCAL
1 TAB (/LIM)
2 ALFA (A10) init <'X'>
END-DEFINE
display *OCC(tab.alfa) *LBOUND(tab.alfa) *UBOUND(tab.alfa)
WRITE '=' ALFA(*)
display *OCC(tab.alfa) *LBOUND(tab.alfa) *UBOUND(tab.alfa)
END
```

output:

```auto
Page 1

    OCC LBOUND UBOUND
----------- ----------- -----------

          0 1 0
ALFA: X
          0 1 0
```

That’s odd.

So I tell you an old programmer’s wisdom: This is a compiler bug.  
… and I think it was also on Windows and fixed between NAT6.2 and NAT6.3

Regards

Matthias

---

<div class="post-metadata">

**Author:** ![Teodoro\_Sibelo](https://avatars.discourse-cdn.com/v4/letter/t/f04885/32.png) [@Teodoro\_Sibelo](https://techcommunity.softwareag.com/u/Teodoro_Sibelo)\
**Post date:** [February 2, 2012, 3:57pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626/5 "2012-02-02T15:57:59Z")

</div>

Thanks Matthias for your quick and accurate response.

---

<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:** [February 5, 2012, 4:33pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626/6 "2012-02-05T16:33:15Z")

</div>

> [@Matthias](#):
>
> I got an old NAT6.1@WinXP. Your code is running there. :!:

Here at home I got Nat6.2@Win2k. The bug is still there.

So I think an Upgrade to 6.3 will fix this on solaris, too.

---

<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:01pm UTC](https://techcommunity.softwareag.com/t/hi-all-i-have-a-problem-with-this-natural-code/99626/7 "2021-04-02T15:01:30Z")

</div>


