# Opening a workfile in APPEND mode in BATCH mode

**URL:** <https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [August 19, 2008, 10:59pm UTC](https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812 "2008-08-19T22:59:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Latin\_Philo](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@Latin\_Philo](https://techcommunity.softwareag.com/u/Latin_Philo)\
**Post date:** [August 19, 2008, 10:59pm UTC](https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812/1 "2008-08-19T22:59:43Z")

</div>

Hi Everybody,

Is there a way to set the Workfile Attribute to APPEND and/or DELETE from a script on Unix? I combed through the documentation and tried a few things myself but I do not seem to be able to do it. I was expecting to be able to do one of the following:

1. Pass a dynamic parameter WORKATTRnn=APPEND to override the default natparm.
2. Adding something to the CMWRKnn definition: CMWRKmm=“$USERDIR/temp/WORKFILE.TXT;APPEND”  
or
3. Passing another input in the batch script CMATTRnn=APPEND

None of these are working. It is not practical for us to set the defaults in the natparm module we use as we would like the developers and users to override it as needed, more or less like in JCL’s DISP= statement.

Thanks in advance for any hints/help.  
Cicero

---

<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:** [August 20, 2008, 3:45am UTC](https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812/2 "2008-08-20T03:45:27Z")

</div>

[url][http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat634unx/sm/definewo.htm[/url]](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat634unx/sm/definewo.htm%5B/url%5D)

```auto
 DEFINE WORK FILE n [operand1] [TYPE operand2] [ATTRIBUTES {operand3}...]
```

ATTRIBUTES Clause:

operand3 specifies a work file attribute.

Several attributes separated by a comma or a blank can be specified, for example:

DEFINE WORK FILE ATTRIBUTES ‘APPEND,KEEP’

* * *

If you need to set this dynamically, pass a parameter to the program from your script and set the ATTRIBUTES operand accordingly.

---

<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:** [August 20, 2008, 4:11pm UTC](https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812/3 "2008-08-20T16:11:34Z")

</div>

> [@Wolfgang Winter](#):
>
> ATTRIBUTES Clause:

This is a rather new feature of Natural, isn’t it? There’s no ATTRIBUTES option in my DEFINE WORK FILE documentation (Nat 6.1.1).

---

<div class="post-metadata">

**Author:** ![Latin\_Philo](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@Latin\_Philo](https://techcommunity.softwareag.com/u/Latin_Philo)\
**Post date:** [August 20, 2008, 11:35pm UTC](https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812/4 "2008-08-20T23:35:55Z")

</div>

Thanks for the reply Wolfgang. We will just stick with the “workfile shuffle” in the script to append the two files after the job finished.

Cicero

---

<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:** [August 21, 2008, 3:39am UTC](https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812/5 "2008-08-21T03:39:00Z")

</div>

It first appeared in Natural 6.2

> [@Matthias](#):
>
> > [@Wolfgang Winter](#):
> >
> > ATTRIBUTES Clause:
> 
> This is a rather new feature of Natural, isn’t it? There’s no ATTRIBUTES option in my DEFINE WORK FILE documentation (Nat 6.1.1).

---

<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:50pm UTC](https://techcommunity.softwareag.com/t/opening-a-workfile-in-append-mode-in-batch-mode/78812/6 "2021-04-02T14:50:47Z")

</div>


