# Open a work file for append in BS2000

**URL:** <https://techcommunity.softwareag.com/t/open-a-work-file-for-append-in-bs2000/96801>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [April 15, 2011, 1:28pm UTC](https://techcommunity.softwareag.com/t/open-a-work-file-for-append-in-bs2000/96801 "2011-04-15T13:28:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorg\_Eckersberg](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@Jorg\_Eckersberg](https://techcommunity.softwareag.com/u/Jorg_Eckersberg)\
**Post date:** [April 15, 2011, 1:28pm UTC](https://techcommunity.softwareag.com/t/open-a-work-file-for-append-in-bs2000/96801/1 "2011-04-15T13:28:00Z")

</div>

Hi,

i want to open a work file for append.  
This is my code:

```auto

#DSNAME := 'SYS.ACCOUNT.2011-03-*'
FIND CATALOG-VIEW WITH DSNAME = #DSNAME AND NODE = #NODE
  FIND ACFILE-VIEW WITH DATEINAME = ACDATEINAME
    IF NO RECORDS FOUND
      STORE RECORD IN FILE ACFILE-VIEW
      DEFINE WORK FILE 1 DSNAME
      DEFINE WORK FILE 5 'ACCOUTTDEV' ATTRIBUTES 'EXTEND,KEEP'
      FETCH RETURN 'ACHAUPT'
      CLOSE WORK FILE 1
      CLOSE WORK FILE 5
    END-NOREC
  END-FIND
END-FIND
```

In the program ACHAUPT the program writes data in the work file 5.

```auto

VALUE 'TDEV' 
   #ANZAHLTDEV := #ANZAHLTDEV + 1 
   WRITE WORK FILE 5 VARIABLE #SATZKENNUNG #ZEITSTEMPEL 
                           #GKZTHEX #GGINFOHEX #ZUSATZ #INFODYNAMIC 
    FETCH RETURN 'ACTDEVP' 
```

I want to process all files from March 2011, which works so far.  
I can see this in the database-file and in the outputfile.  
But in the work file ‘ACOUTTDEV’ I can only find data from 31.03.2011.

Thanks for your help.

Jörg

---

<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:** [April 15, 2011, 2:21pm UTC](https://techcommunity.softwareag.com/t/open-a-work-file-for-append-in-bs2000/96801/2 "2011-04-15T14:21:42Z")

</div>

The Natural 427 manual states

> [@](#):
>
> ATTRIBUTES Clause:  
> This clause makes sense only in Natural for Open Systems; in Natural for Mainframes it is ignored."

So, ATTRIBUTES ‘APPEND, KEEP’ won’t work.

Try “DISP=(MOD,” for CMWKF05 in your JCL (or the equivalent for BS2000).

---

<div class="post-metadata">

**Author:** ![Jorg\_Eckersberg](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@Jorg\_Eckersberg](https://techcommunity.softwareag.com/u/Jorg_Eckersberg)\
**Post date:** [April 15, 2011, 5:02pm UTC](https://techcommunity.softwareag.com/t/open-a-work-file-for-append-in-bs2000/96801/3 "2011-04-15T17:02:09Z")

</div>

Thank you very much. It’s OK.

---

<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:00pm UTC](https://techcommunity.softwareag.com/t/open-a-work-file-for-append-in-bs2000/96801/4 "2021-04-02T15:00:05Z")

</div>


