# How to pass a constant to server in the assign function

**URL:** <https://datashield.discourse.group/t/how-to-pass-a-constant-to-server-in-the-assign-function/241>\
**Category:** Developer support\
**Created:** [25 June 2020 11:36 UTC](https://datashield.discourse.group/t/how-to-pass-a-constant-to-server-in-the-assign-function/241 "2020-06-25T11:36:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HankCao](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HankCao](https://datashield.discourse.group/u/HankCao)\
**Post date:** [25 June 2020 11:36 UTC](https://datashield.discourse.group/t/how-to-pass-a-constant-to-server-in-the-assign-function/241/1 "2020-06-25T11:36:42Z")

</div>

Dear all,

If I want to create a zero vector of length 40 in the server, how should I do? See below errors:

```
datashield.assign.expr(opals[[2]], "w", quote(repDS("0", "40")))
Error in .appendError(n, e$message) : object 'n' not found
```

---

<div class="post-metadata">

**Author:** ![demetris.avraam](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@demetris.avraam](https://datashield.discourse.group/u/demetris.avraam)\
**Post date:** [25 June 2020 13:28 UTC](https://datashield.discourse.group/t/how-to-pass-a-constant-to-server-in-the-assign-function/241/2 "2020-06-25T13:28:14Z")

</div>

Hi Hank,

Here is the way on how you can generate the zero vector of length 40 in the server “opals[[2]]”:

ds.rep(x1 = 0, times = 40, length.out = NA, each = 1, source.x1 = “clientside”, source.times = “c”, source.length.out = NULL, source.each = “c”, x1.includes.characters = FALSE, newobj = “w”, datasources = opals[[2]])

---

<div class="post-metadata">

**Author:** ![HankCao](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HankCao](https://datashield.discourse.group/u/HankCao)\
**Post date:** [25 June 2020 13:44 UTC](https://datashield.discourse.group/t/how-to-pass-a-constant-to-server-in-the-assign-function/241/3 "2020-06-25T13:44:23Z")

</div>

Great, thanks a lot Hank
