# Handling dynamic variables

**URL:** <https://techcommunity.softwareag.com/t/handling-dynamic-variables/205755>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [October 10, 2019, 12:57pm UTC](https://techcommunity.softwareag.com/t/handling-dynamic-variables/205755 "2019-10-10T12:57:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_M\_Nair](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@Prashant\_M\_Nair](https://techcommunity.softwareag.com/u/Prashant_M_Nair)\
**Post date:** [October 10, 2019, 12:57pm UTC](https://techcommunity.softwareag.com/t/handling-dynamic-variables/205755/1 "2019-10-10T12:57:06Z")

</div>

Hi,

Can anyone help me with a sample where I can move values from a Dynamic variable to a defined array correctly?

---

<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:** [October 10, 2019, 5:22pm UTC](https://techcommunity.softwareag.com/t/handling-dynamic-variables/205755/2 "2019-10-10T17:22:05Z")

</div>

It is not clear to me exactly what you wish to do, but try this for a start.

```auto
DEFINE DATA LOCAL
1 #DYN (A) DYNAMIC INIT <'ONEtwoTHREE'>
1 #ARR (A10/5)
END-DEFINE
MOVE SUBSTR (#DYN, 1, 3) TO #ARR (1)
MOVE SUBSTR (#DYN, 4, 3) TO #ARR (2)
MOVE SUBSTR (#DYN, 7, 5) TO #ARR (3)
PRINT '=' #DYN
DISPLAY (ES=T) #ARR (*)
END
```

```auto
Page 1 10/10/19 08:18:28
 
   #ARR
----------
 
#DYN: ONEtwoTHREE
ONE
two
THREE
```

---

<div class="post-metadata">

**Author:** ![Jerome\_LeBlanc](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/jerome_leblanc/32/111_2.png) [@Jerome\_LeBlanc](https://techcommunity.softwareag.com/u/Jerome_LeBlanc)\
**Post date:** [October 10, 2019, 11:58pm UTC](https://techcommunity.softwareag.com/t/handling-dynamic-variables/205755/3 "2019-10-10T23:58:16Z")

</div>

Or if your dynamic variable is delimited, the SEPARATE statement would work.

---

<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:43pm UTC](https://techcommunity.softwareag.com/t/handling-dynamic-variables/205755/4 "2021-04-02T15:43:38Z")

</div>


