# READ WORK FILE

**URL:** <https://techcommunity.softwareag.com/t/read-work-file/75577>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [October 26, 2007, 11:04am UTC](https://techcommunity.softwareag.com/t/read-work-file/75577 "2007-10-26T11:04:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![subba](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@subba](https://techcommunity.softwareag.com/u/subba)\
**Post date:** [October 26, 2007, 11:04am UTC](https://techcommunity.softwareag.com/t/read-work-file/75577/1 "2007-10-26T11:04:11Z")

</div>

Hi

When I am reading a dataset through READ WORK FILE. I would like check wether if the file is empty or not. How can do this. If it is Natural read statement I can check through \*NUMBER. Please help me in this regard.

TIA.

Subba

---

<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:** [October 26, 2007, 11:51am UTC](https://techcommunity.softwareag.com/t/read-work-file/75577/2 "2007-10-26T11:51:00Z")

</div>

> [@subba](#):
>
> How can do this. If it is Natural read statement I can check through \*NUMBER.

You’re right. \*NUMBER or \*COUNTER is not filled. AFAIK you have to count on your own…

```auto
READ WORK FILE 1 #a30
add 1 to #counter
END-WORK
```

---

<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 26, 2007, 12:08pm UTC](https://techcommunity.softwareag.com/t/read-work-file/75577/3 "2007-10-26T12:08:20Z")

</div>

```auto
READ WORK 1 ONCE RECORD field list
  AT END OF FILE
    WRITE 'Work file 1 is empty; header record not found'
    STOP
  END-ENDFILE
process header record
/*
READ WORK 1 RECORD field list
  process detail record
END-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, 2:48pm UTC](https://techcommunity.softwareag.com/t/read-work-file/75577/4 "2021-04-02T14:48:51Z")

</div>


