# Syntax problem, when adainv called

**URL:** <https://techcommunity.softwareag.com/t/syntax-problem-when-adainv-called/58067>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Linux, Adabas-Utilities-on-Open-Systems\
**Created:** [June 27, 2006, 4:52pm UTC](https://techcommunity.softwareag.com/t/syntax-problem-when-adainv-called/58067 "2006-06-27T16:52:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spbest](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spbest](https://techcommunity.softwareag.com/u/spbest)\
**Post date:** [June 27, 2006, 4:52pm UTC](https://techcommunity.softwareag.com/t/syntax-problem-when-adainv-called/58067/1 "2006-06-27T16:52:02Z")

</div>

Hello !  
I want to start an Adabas invert for 1 spd, but I get a syntax error during script execution:

#!/bin/sh

ASSO1=$ADADIR/db014/ASSO1.014  
export ASSO1  
DATA1=$ADADIR/db014/DATA1.014  
export DATA1  
WORK1=$ADADIR/db014/WORK1.014  
export WORK1  
export INVERR=$HOME/bat/INVERT.err  
export SYSOUT=$HOME/bat/INVERT.out

adainv dbid=014 invert=256 fields cp=ab(1,12),ad(1,14) end\_of\_fields \> $SYSOUT

… & the error string:

./invert.bsh: line 12: syntax error near unexpected token `(' ./invert.bsh: line 12: `adainv dbid=014 invert=256 fields cp=ab(1,12),ad(1,14) end\_of\_fields \> $SYS

Could somebody explain me, how should I write the script. Is it possible at all, to create new spd with like looking script ?  
I tried to create descr. for one normal field, it goes without problems. ☹

Platform: x86, RH AS 3, Adabas 3x

---

<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:** [June 27, 2006, 6:55pm UTC](https://techcommunity.softwareag.com/t/syntax-problem-when-adainv-called/58067/2 "2006-06-27T18:55:20Z")

</div>

> [@spbest](#):
>
> ./invert.bsh: line 12: syntax error near unexpected token `(' ./invert.bsh: line 12: `adainv dbid=014 invert=256 fields cp=ab(1,12),ad(1,14) end\_of\_fields \> $SYS

Left and right parenthesis are special characters and therefore interpreted by the shell. Please put your parenthesis in single quotes to avoid this error.  
Example:

```auto
adainv dbid=014 invert=256 fields cp='ab(1,12),ad(1,14)' end_of_fields > $SYS
```

---

<div class="post-metadata">

**Author:** ![spbest](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spbest](https://techcommunity.softwareag.com/u/spbest)\
**Post date:** [August 23, 2006, 6:17pm UTC](https://techcommunity.softwareag.com/t/syntax-problem-when-adainv-called/58067/3 "2006-08-23T18:17:51Z")

</div>

Excuse me, I didn’t have any time to answer in June.  
I have tried the suggested changes. Despite entering these ’ characters, the syntax error appeared.  
Next have I removed the first line from the script  
( #!/bin/sh ). It goes very well now 😃 .  
I suggest to publish some advice in Adabas Docu (e.g. my (finally corrected) example of use of the ADAINV utility 😉 ).  
Thank you.

---

<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:39pm UTC](https://techcommunity.softwareag.com/t/syntax-problem-when-adainv-called/58067/4 "2021-04-02T14:39:01Z")

</div>


