# Reading work file from a unix named pipe

**URL:** <https://techcommunity.softwareag.com/t/reading-work-file-from-a-unix-named-pipe/204165>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [June 13, 2019, 11:23pm UTC](https://techcommunity.softwareag.com/t/reading-work-file-from-a-unix-named-pipe/204165 "2019-06-13T23:23:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Bergeson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/lars_bergeson/32/1271_2.png) [@Lars\_Bergeson](https://techcommunity.softwareag.com/u/Lars_Bergeson)\
**Post date:** [June 13, 2019, 11:23pm UTC](https://techcommunity.softwareag.com/t/reading-work-file-from-a-unix-named-pipe/204165/1 "2019-06-13T23:23:39Z")

</div>

I have 2 large work files I need to read as one work file concatenated together. Seems like Unix named pipes are the way to go. But when I try to read a work file that is a named pipe, I get this error:

NAT6220 Internal error when reading work file.

My Unix script is:

```auto
mkfifo $PWD/catpipe
cat File1.txt File2.txt >$PWD/catpipe &
echo ONE-WAY,BERGESL,passwd >cmobjin.txt
echo LBRDWK >cmsynin.txt
echo FIN >>cmsynin.txt
natural parm=nputeb33 bp=bpteuuat etid=$$ BATCHMODE auto=off\
    CMSYNIN=cmsynin.txt CMOBJIN=cmobjin.txt natlog=all\
    CMPRINT=cmprint.txt CMWRK01=$PWD/catpipe
```

The Natural program LBRDWK is:

```auto
DEFINE DATA LOCAL
1 #IN (A50)
END-DEFINE
READ WORK FILE 1 #IN
  WRITE #IN
END-WORK
END
```

We’re running Natural 8.3.7 on AIX 6.1.0.0

Anyone have any ideas on how to get this to work?

Thanks.

---

<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:** [June 14, 2019, 12:21am UTC](https://techcommunity.softwareag.com/t/reading-work-file-from-a-unix-named-pipe/204165/2 "2019-06-14T00:21:33Z")

</div>

The basic problem here is, imho, that natural can’t determine the workfile type, did you set it in your natparm ?

I can get it to “work” when I add a DEFINE WORK TYPE “ASCII” (using two simple lf text files in my test),  
but “working” is relative, there’s no error, but no data read/printed either. When I feed the pipe interactively  
from a 2nd shell it sits there waiting until I “read” it from the natural program, then the cat process ends.

The documentation doesn’t give a clue if this is a supported scenario, so this calls for an incident  
asking for clarification, I’d say.

---

<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:** [June 14, 2019, 6:37pm UTC](https://techcommunity.softwareag.com/t/reading-work-file-from-a-unix-named-pipe/204165/3 "2019-06-14T18:37:58Z")

</div>

A few years ago, a client of mine (AIX platform) researched this and was told by Support that named pipes were not officially supported, although it could be made to work under specific circumstances. I tried an Empower search, but couldn’t find any references to this inquiry.

---

<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:42pm UTC](https://techcommunity.softwareag.com/t/reading-work-file-from-a-unix-named-pipe/204165/4 "2021-04-02T15:42:56Z")

</div>


