# Getting error NAT0178 with Examine on Xarray

**URL:** <https://techcommunity.softwareag.com/t/getting-error-nat0178-with-examine-on-xarray/97791>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [July 23, 2011, 2:58am UTC](https://techcommunity.softwareag.com/t/getting-error-nat0178-with-examine-on-xarray/97791 "2011-07-23T02:58:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogesh1](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@Yogesh1](https://techcommunity.softwareag.com/u/Yogesh1)\
**Post date:** [July 23, 2011, 2:58am UTC](https://techcommunity.softwareag.com/t/getting-error-nat0178-with-examine-on-xarray/97791/1 "2011-07-23T02:58:28Z")

</div>

I am getting error NAT0178 when I use Examine statement on 2 dimensional Xarray to find the specific index. For Example:

DEFINE DATA LOCAL  
1 #ARR1 (1:_)  
2 #ITM (A6)  
2 #ARR2 (A10/1:_)  
1 #I (I2)  
1 #J (I2)  
1 #INDEX1 (N2)  
1 #INDEX2 (N2)  
…  
…  
EXPAND ARRAY #ARR1 TO (1:5)  
EXPAND ARRAY #ARR2 TO (1:\*,1:20)  
FOR #I 1 TO 5  
#ITM(#I) := #I  
FOR #J 1 TO 20  
COMPRESS #ARR2(#I,#J) #I #J INTO #ARR2(#I,#J) LEAVING NO SPACE  
END-FOR  
END-FOR

EXAMINE #ITM(\*) FOR ‘2’ GIVING INDEX #INDEX  
…  
…  
…  
…

EXAMINE #ARR2(#INDEX,\*) ‘12’ GIVING INDEX #INDEX2

First examine statement works fine but second examine gives error NAT0178.

---

<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:** [July 23, 2011, 3:42am UTC](https://techcommunity.softwareag.com/t/getting-error-nat0178-with-examine-on-xarray/97791/2 "2011-07-23T03:42:28Z")

</div>

Despite the fact that you have provided the first index value in #INDEX, the syntax of the GIVING INDEX clause requires a variable for each dimension.

```auto
EXAMINE #ARR2 (#INDEX, *) FOR '12' GIVING INDEX #INDEX-ONE #INDEX-TWO
```

---

<div class="post-metadata">

**Author:** ![Yogesh1](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@Yogesh1](https://techcommunity.softwareag.com/u/Yogesh1)\
**Post date:** [July 23, 2011, 8:30am UTC](https://techcommunity.softwareag.com/t/getting-error-nat0178-with-examine-on-xarray/97791/3 "2011-07-23T08:30:51Z")

</div>

yes, it worked. Thanks a lot for quick reply.

---

<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:00pm UTC](https://techcommunity.softwareag.com/t/getting-error-nat0178-with-examine-on-xarray/97791/4 "2021-04-02T15:00:38Z")

</div>

Closed on April 2, 2021, 3:00pm UTC


