# RPC: Different Parameter handling?

**URL:** <https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Remote-Procedure-Call-RPC, Natural-on-Windows-Unix\
**Created:** [April 11, 2012, 2:06pm UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137 "2012-04-11T14:06:23Z")\
**Posts on this page:** 8\
**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:** [April 11, 2012, 2:06pm UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137/1 "2012-04-11T14:06:23Z")

</div>

Hello all!

Here’s a sample subprogram:

```auto
define data parameter
1 #a-dyn (A) dynamic
end-define
compress numeric *TIMX to #a-dyn
end
```

It’s called via RPC by the following program:

```auto
define data local
01 #a-dyntab (A/1:2) dynamic
01 #i1 (I1)
end-define
for #i1 = 1 to *UBOUND(#a-dyntab)
callnat 'RPCTESTN' #a-dyntab(#i1)
display #i1 #a-dyntab(#i1) (AL=50)
end-for
end
```

Output:

```auto
#I1 #A-DYNTAB
---- --------------------------------------------------

   1 14:05:11
   2
```

:shock:  
Is this some different parameter handling or is this a bug?

RPC-client: Nat 6.3.9@Solaris  
RPC-Server: Nat 6.3.9@Win2003

Regards

Matthias

---

<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 11, 2012, 2:21pm UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137/2 "2012-04-11T14:21:00Z")

</div>

It should definitely behave alike when called interactively or via RPC,  
so I’d say time to raise an incident.

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [April 11, 2012, 2:35pm UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137/3 "2012-04-11T14:35:35Z")

</div>

Agree with Wolfgang - Empower Time !

Also reproes under nat6.3.10 and exx821 on windows

---

<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:** [April 11, 2012, 3:15pm UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137/4 "2012-04-11T15:15:38Z")

</div>

Thank you for reproducing. Incident is raised.

BTW: Here’s another one:

```auto
define data parameter
1 #N1-tab (n1/1:*)
end-define
expand array #n1-tab to (1:3)
#N1-tab(1) := 1
#N1-tab(2) := 2
#N1-tab(3) := 3
end
```

```auto
define data local
1 #struct(1:*)
  2 #rpc-struct
    3 #n1 (N1)
  2 #other-struct
    3 #a1 (A1)
end-define
* expand array #struct to (1:2) /* works if this line is uncommented
callnat 'RPCTESTN' #rpc-struct(*)
write 'OCC #n1' *OCC(#n1)
write 'OCC #a1' *OCC(#a1)
* display #struct(*) /* would throw NAT1257 here
end
```

output:

```auto
OCC #n1 3
OCC #a1 0
```

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [April 11, 2012, 4:09pm UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137/5 "2012-04-11T16:09:25Z")

</div>

hehe - but this is different 😉  
Here you are cheating Natural into allowing something “un-natural” 😉  
If you run this one locally you will get a nat1255 because you try to allocate a sub-part of a structure.

So if this is a bug - it is a parser bug for allowing a x-array sub-part as a parameter - or what do you say ?

Finn

---

<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:** [April 11, 2012, 9:37pm UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137/6 "2012-04-11T21:37:58Z")

</div>

> [@Finn the Dane](#):
>
> If you run this one locally you will get a nat1255 because you try to allocate a sub-part of a structure.

On Nat6.2@Windows you can reproduce it locally…

---

<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:** [April 12, 2012, 7:18am UTC](https://techcommunity.softwareag.com/t/rpc-different-parameter-handling/100137/7 "2012-04-12T07:18:07Z")

</div>

> [@Finn the Dane](#):
>
> or what do you say ?

SAG-support replies, that the first example looks like a bug.  
But the second one “is not an error”.  
I think you’re right. NAT1255 would be correct.

---

<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/rpc-different-parameter-handling/100137/8 "2021-04-02T15:01:45Z")

</div>


