# NAT0936 compilation error calling a user-defined function

**URL:** <https://techcommunity.softwareag.com/t/nat0936-compilation-error-calling-a-user-defined-function/75067>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [July 20, 2007, 8:17pm UTC](https://techcommunity.softwareag.com/t/nat0936-compilation-error-calling-a-user-defined-function/75067 "2007-07-20T20:17:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djh](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@djh](https://techcommunity.softwareag.com/u/djh)\
**Post date:** [July 20, 2007, 8:17pm UTC](https://techcommunity.softwareag.com/t/nat0936-compilation-error-calling-a-user-defined-function/75067/1 "2007-07-20T20:17:49Z")

</div>

Hi

---

<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:** [July 21, 2007, 3:19am UTC](https://techcommunity.softwareag.com/t/nat0936-compilation-error-calling-a-user-defined-function/75067/2 "2007-07-21T03:19:51Z")

</div>

if you add “by value” to the input parameters, it should work (see examples [http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat631win/pg/pg\_udf.htm#recurs](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat631win/pg/pg_udf.htm#recurs))

If you do not use “by value”, the call must match in format and length, as noted ([http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat631win/sm/definefu.htm](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat631win/sm/definefu.htm)):

> [@](#):
>
> If the BY VALUE keyword is missing, the format-length of the RETURNS clause must match the format-length which is returned by the function evaluated at run time.

Since the default format for literal numbers less than 32767 is I2, they do not match your prototype.

---

<div class="post-metadata">

**Author:** ![djh](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@djh](https://techcommunity.softwareag.com/u/djh)\
**Post date:** [July 21, 2007, 3:18pm UTC](https://techcommunity.softwareag.com/t/nat0936-compilation-error-calling-a-user-defined-function/75067/3 "2007-07-21T15:18:49Z")

</div>

Thanks a lot for the prompt reply!

> [@](#):
>
> Since the default format for literal numbers less than 32767 is I2, they do not match your prototype.

Yes, that is the explanation. I did not think of it - or maybe wasn’t even aware that this is so. :oops:  
Thanks again,

---

<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:48pm UTC](https://techcommunity.softwareag.com/t/nat0936-compilation-error-calling-a-user-defined-function/75067/4 "2021-04-02T14:48:34Z")

</div>


