# VARRAY values in wrong position

**URL:** <https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808>\
**Category:** Forum\
**Tags:** Mainframe-Integration, EntireX\
**Created:** [July 14, 2015, 5:47pm UTC](https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808 "2015-07-14T17:47:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Johnson1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/brian_johnson1/32/163_2.png) [@Brian\_Johnson1](https://techcommunity.softwareag.com/u/Brian_Johnson1)\
**Post date:** [July 14, 2015, 5:47pm UTC](https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808/1 "2015-07-14T17:47:53Z")

</div>

We have a Natural subprogram whose PDA looks like this:

```auto
1 #MESSAGE-ID A 25
1 #X_ITEM_DATA (1:*)
   2 #ITEM_CODE A 18
   2 #DESCRIPTION A 150
   2 #LONG_DESCRIPTION A 240
   2 #PRIMARY_UOM A 2
   2 #STATUS_CODE A 40
   2 #ITEM_UDA_DATA_TABLE (1:*)
      3 #ATTR_NAME A 150
      3 #ATTR_DISP_VALUE A 250
   2 #ITEM_REPLACE_DATA (1:*) /*PP#43598
      3 #TYPE A 80 /*PP#43598
      3 #FROM_ITEM A 40 /*PP#43598
      3 #TO_ITEM A 40 /*PP#43598
1 #OUTPUT
   2 #SUCCESS_STATUS A 1
   2 #ERROR_DETAIL A 250
```

I suspect that the values for #ITEM\_UDA\_DATA\_TABLE are provided for each occurrence of #X\_ITEM\_DATA, but it appears that this new #ITEM\_REPLACE\_VALUE is sometimes provided for each occurrence of #X\_ITEM\_DATA in the XML payload.

In one test case (XML sample attached), the first set of attributes for #X\_ITEM\_DATA did not send tags/data for #ITEM\_REPLACE\_VALUE, and the second set did. However, when Natural received the data, these #ITEM\_REPLACE\_VALUE values appeared in occurrence 1 which correlates to the 1st product, and so the Natural program not knowing differently handled them as such.

I would have expected these to appear in the Natural subprogram as such:

#TYPE(2,1) = ‘Substitute’  
#FROM-ITEM(2,1) = ‘CLB201224’  
#TO-ITEM(2,1) = ’ ’

#TYPE(2,2) = ‘Replacement’  
#FROM-ITEM(2,2) = ’ ’  
#TO-ITEM(2,2) = ‘BR1224N200R’

However, they appeared as occurrences (1,1) and (1,2).

Is there a way we can configure or organize the parameters such that if no #ITEM\_REPLACE\_DATA is ascribed to the first product but is ascribed to the second, that the 1st occurrence of #ITEM\_REPLACE\_DATA is blank and the 2nd occurrence retains the data in the intended occurrence?

Thanks,

Brian

[XML.XML](https://techcommunity.softwareag.com/uploads/short-url/vjZzl4PkkdVt5GyVlcqnihUReEK.XML) (7.62 KB)

---

<div class="post-metadata">

**Author:** ![anon66457657](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@anon66457657](https://techcommunity.softwareag.com/u/anon66457657)\
**Post date:** [July 15, 2015, 8:51am UTC](https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808/2 "2015-07-15T08:51:38Z")

</div>

Brian,  
which version of the Natural RPC server are you using?  
Thank you  
Wolfgang

---

<div class="post-metadata">

**Author:** ![Brian\_Johnson1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/brian_johnson1/32/163_2.png) [@Brian\_Johnson1](https://techcommunity.softwareag.com/u/Brian_Johnson1)\
**Post date:** [July 15, 2015, 2:21pm UTC](https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808/3 "2015-07-15T14:21:58Z")

</div>

Hi Wolfgang,

Currently the environment is as such:

```auto
*** Initialize a Natural RPC server at 2015-07-12 23:31:06   
*** with name SRV1                                         
*** on host CH40                                         
*** under z/OS 01.07.00                                
*** Natural nucleus version : 4.2.7                    
*** Natural system file version : 4.2.7 service pack 14    
*** Natural RPC version : 6.3.4 update level 0     
*** Highest supported RPC protocol: 2030                     
*** SYSIDL version : 6.3.13.0    
```

I know that’s old, but the good news is we are cutting over this weekend to the BC12 mainframe which will have this as the environment:

```auto
*** Initialize a Natural RPC server at 2015-07-14 08:45:46  
*** with name SRV1                                        
*** on host CH40                                        
*** under z/OS 02.01.00                               
*** Natural nucleus version : 8.2.4                   
*** Natural system file version : 8.2.4                   
*** Natural RPC version : 8.2.4                   
*** Highest supported RPC protocol: 2040                    
*** SYSIDL version : 6.3.13.0       
```

Do you believe that will make a difference in how Natural receives the data from the XML payload?

-Brian

---

<div class="post-metadata">

**Author:** ![anon66457657](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@anon66457657](https://techcommunity.softwareag.com/u/anon66457657)\
**Post date:** [July 15, 2015, 4:42pm UTC](https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808/4 "2015-07-15T16:42:45Z")

</div>

Hi Brian,  
according to the described symptoms the Natural RPC server of NAT824 should solve the problem.  
I would even recommend to use the Natural RPC NATRPC82 of NAT825L003 which is compatiblle with NAT824.  
Best regards  
Wolfgang

---

<div class="post-metadata">

**Author:** ![Brian\_Johnson1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/brian_johnson1/32/163_2.png) [@Brian\_Johnson1](https://techcommunity.softwareag.com/u/Brian_Johnson1)\
**Post date:** [July 15, 2015, 6:58pm UTC](https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808/5 "2015-07-15T18:58:46Z")

</div>

Wolfgang,

Many thanks for your help and advice! I will test under Natural 824 and with the NATRPC82 version supplied with NAT825L003 to see if this resolves the issue of how the input XML data maps to the Natural PDA.

Regds,

Brian

---

<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:33pm UTC](https://techcommunity.softwareag.com/t/varray-values-in-wrong-position/182808/6 "2021-04-02T15:33:48Z")

</div>


