# READ WORK in Linux BATCHMODE

**URL:** <https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [April 24, 2017, 9:43am UTC](https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262 "2017-04-24T09:43:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rok\_Purkeljc](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Rok\_Purkeljc](https://techcommunity.softwareag.com/u/Rok_Purkeljc)\
**Post date:** [April 24, 2017, 9:43am UTC](https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262/1 "2017-04-24T09:43:05Z")

</div>

Hi,

I’m trying to read a work file with Natural for Linux in Batch Mode with the following parameters:

```auto

natural BATCHMODE CMSYNIN=cmd.nat CMOBJIN=data CMPRINT=out.txt CMWRK01=data.in NATLOG=ALL

cat cmd.nat:
LOGON SYSEXBAT
EXECUTE RPTEST01
FIN

cat RPTEST01:
DEFINE DATA
LOCAL
1 #IN (A70)
END-DEFINE
DEFINE WORK FILE 1 'data.in' TYPE 'CSV'

INPUT (IP=OFF AD=M) #IN
DISPLAY #IN

READ WORK FILE 1 #IN
  DISPLAY #IN
END-WORK
END

cat data:
Test

cat data.in:
Ben Smith

```

And get the following unhelpful error message:

Natural Run-Time Error: 61

Execution or compilation error occured.

What am I doing wrong?

Regards,  
Rok

---

<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 25, 2017, 1:46am UTC](https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262/2 "2017-04-25T01:46:13Z")

</div>

Is the environment secured? Natural Security might be expecting the first input line to contain library,userid,password rather than “LOGON SYSEXBAT”. This might resolve the problem.

By the way, since you have specified the file name for CMWRK01 in your script, there is no need to duplicate it in the program.

```auto
DEFINE WORK FILE 1 TYPE 'CSV'
```

---

<div class="post-metadata">

**Author:** ![Rok\_Purkeljc](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Rok\_Purkeljc](https://techcommunity.softwareag.com/u/Rok_Purkeljc)\
**Post date:** [April 25, 2017, 8:36am UTC](https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262/3 "2017-04-25T08:36:47Z")

</div>

The environment is not yet secured, it is a simple “out-of-the-box” installation of Natural for Linux. Other sample programs from the SYSEXBAT Library work fine (also without providing Login Information).

Perhaps there is something missing in the NATPARM Batch Paramter Configuration…

> [@](#):
>
> By the way, since you have specified the file name for CMWRK01 in your script, there is no need to duplicate it in the program.

That was my first assumption why it didn’t work - that perhaps I have to define the Work file explicitly in the Program…

---

<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 25, 2017, 7:59pm UTC](https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262/4 "2017-04-25T19:59:10Z")

</div>

Exit code 61 is a generic message simply indicating that something went wrong. There should be additional information in out.txt.

Try running it on-line. With the program in the editor, ensure that the DEFINE WORK contains the file name (that I previously suggested you remove), and RUN. If successful, you know the issue is in the script.

Also, try fully qualifying the file name. That goes for both script and on-line methods.

---

<div class="post-metadata">

**Author:** ![Rok\_Purkeljc](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Rok\_Purkeljc](https://techcommunity.softwareag.com/u/Rok_Purkeljc)\
**Post date:** [April 26, 2017, 9:32am UTC](https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262/5 "2017-04-26T09:32:12Z")

</div>

Hello Ralph,

thanks for your help.

> [@Ralph Zbrog](#):
>
> Also, try fully qualifying the file name. That goes for both script and on-line methods.

That was it… The Workfile couldn’t be found until I specified the full path with CMWRK01…

Regards,  
Rok

---

<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:38pm UTC](https://techcommunity.softwareag.com/t/read-work-in-linux-batchmode/194262/6 "2021-04-02T15:38:20Z")

</div>


