# Initialization of numeric arrays

**URL:** <https://techcommunity.softwareag.com/t/initialization-of-numeric-arrays/61101>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-on-Windows-Unix\
**Created:** [June 8, 2006, 10:32pm UTC](https://techcommunity.softwareag.com/t/initialization-of-numeric-arrays/61101 "2006-06-08T22:32:23Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [June 8, 2006, 10:32pm UTC](https://techcommunity.softwareag.com/t/initialization-of-numeric-arrays/61101/1 "2006-06-08T22:32:23Z")

</div>

Hi,

does anybody know about changes in numeric array initializations from Nat3.1.x to Nat4.1.4. I have got the following problem:

```auto

DEFINE DATA LOCAL          
1 #ARR (N2/1:10) CONST    
  (*) <-1>                
  (01) <01>                
  (02) <02>                
  (03) <00>                
  (06) <00>                
  (07) <00>                
  (08) <08>                
1 #I (I4)                  
END-DEFINE                 
FOR #I = 1 TO 10          
  DISPLAY #I(NL=2) #ARR(#I)
END-FOR                    
END                        
```

The occurences 3, 6, 7 are not initialized with zero, but stay to contain -1 (the first step init value).

I think, SAG has “optimized” the init/const statement to avoid initializations with zero values for numeric arrays. Unless you don’t initialize an occurence twice, this seems to be ok. But in my case, it is not!

Is there a ZAP or so available to avoid this problem? Does this problem exist with Open Systems, too?

---

<div class="post-metadata">

**Author:** ![Chad\_Scott](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Chad\_Scott](https://techcommunity.softwareag.com/u/Chad_Scott)\
**Post date:** [June 8, 2006, 11:51pm UTC](https://techcommunity.softwareag.com/t/initialization-of-numeric-arrays/61101/2 "2006-06-08T23:51:49Z")

</div>

On Windows it works OK and sets occurs 3,6, & 7 to 0.  
Mainframe NATv4.1.3 it gives the same results you see both with and without NOC.  
Have you opened a support request?

---

<div class="post-metadata">

**Author:** ![Lukas\_Hundemer](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/lukas_hundemer/32/113_2.png) [@Lukas\_Hundemer](https://techcommunity.softwareag.com/u/Lukas_Hundemer)\
**Post date:** [June 9, 2006, 1:49pm UTC](https://techcommunity.softwareag.com/t/initialization-of-numeric-arrays/61101/3 "2006-06-09T13:49:08Z")

</div>

This looks like a bug.  
I have tried it with NAT 4.2. and it is still the same. 😢  
I would recommend you to open a support request.

---

<div class="post-metadata">

**Author:** ![Vasanth](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@Vasanth](https://techcommunity.softwareag.com/u/Vasanth)\
**Post date:** [June 13, 2006, 5:01pm UTC](https://techcommunity.softwareag.com/t/initialization-of-numeric-arrays/61101/4 "2006-06-13T17:01:59Z")

</div>

It is working fine for me in NAT 3.1.06

---

<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:40pm UTC](https://techcommunity.softwareag.com/t/initialization-of-numeric-arrays/61101/5 "2021-04-02T14:40:41Z")

</div>

Closed on April 2, 2021, 2:40pm UTC


