# SORT

**URL:** <https://techcommunity.softwareag.com/t/sort/59953>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux, Natural-Installation-and-Setup-on-Open-Systems\
**Created:** [May 2, 2005, 7:21pm UTC](https://techcommunity.softwareag.com/t/sort/59953 "2005-05-02T19:21:24Z")\
**Posts on this page:** 15\
**Page:** 1

<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:** [May 2, 2005, 7:21pm UTC](https://techcommunity.softwareag.com/t/sort/59953/1 "2005-05-02T19:21:24Z")

</div>

Hello all!

I got a Runtime-Error, when I use a Natural-SORT under Linux. “Open for work file 33 failed”. The Error occurs on the line with the “END-ALL” Statement.

I guess it has to do with the ADABAS-Sort-Arrea. But the SORT1 was correctly built by ADAFRM. The regarding DB???.INI is correct.

Any ideas?

Thanx for Help!

Matthias

---

<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:** [May 2, 2005, 7:54pm UTC](https://techcommunity.softwareag.com/t/sort/59953/2 "2005-05-02T19:54:32Z")

</div>

No, this has nothing to do with ADABAS SORT.

When a NATURAL (internal) SORT intermediate result set exceeds SORTSZE it will create a SORT work file - in NATURAL’s “temp” directory.

Now, if a user running into this situation does not have write access to the temp directory, you will see this NAT1500 for work file 33.

---

<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:** [May 2, 2005, 8:28pm UTC](https://techcommunity.softwareag.com/t/sort/59953/3 "2005-05-02T20:28:06Z")

</div>

> [@WoWi](#):
>
> Now, if a user running into this situation does not have write access to the temp directory, you will see this NAT1500 for work file 33.

Thanks for answering that quick. Next (maybe stupid) question: Where can I find NATURAL-temp-directory?  
The directory “/sag/nat/v61110/tmp” is obviously not the right one.

I did a search in the natparm-utility for “sort” and found SORTSZE, but no parameter for a tmp-path… :?:

---

<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:** [May 2, 2005, 8:44pm UTC](https://techcommunity.softwareag.com/t/sort/59953/4 "2005-05-02T20:44:17Z")

</div>

In NATPARM:

Configuration → Local Configuration File → Installation Assignments

You’ll find the setting for TMP\_PATH there.

---

<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:** [May 2, 2005, 9:05pm UTC](https://techcommunity.softwareag.com/t/sort/59953/5 "2005-05-02T21:05:20Z")

</div>

> [@WoWi](#):
>
> In NATPARM:
> 
> Configuration → Local Configuration File → Installation Assignments
> 
> You’ll find the setting for TMP\_PATH there.

My TMP\_PATH is  
“/sag/nat/v61110/tmp” and I got all rights on this directory. I tried out some other directories like /tmp or a new empty directory.

But the NAT1500 still apears…

☹

---

<div class="post-metadata">

**Author:** ![Peter\_Dowson](https://avatars.discourse-cdn.com/v4/letter/p/eb9ed0/32.png) [@Peter\_Dowson](https://techcommunity.softwareag.com/u/Peter_Dowson)\
**Post date:** [May 3, 2005, 2:11pm UTC](https://techcommunity.softwareag.com/t/sort/59953/6 "2005-05-03T14:11:03Z")

</div>

This may be a long shot but try making sure that workfile 33 does NOT exist before you run the program. I have seen cases where Natural cannot open an existing file or overwrite it.

If this doesn’t work, try writing a little natural program to write one record to the same workfile. This will eliminate problems with SORT if it also fails,

Peter

---

<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:** [May 3, 2005, 2:20pm UTC](https://techcommunity.softwareag.com/t/sort/59953/7 "2005-05-03T14:20:15Z")

</div>

33 is a “virtual” work file number for SORT processing.

Tried it again, works just perfect for me, I revceive the very same NAT1500 when I try to sort from an “unauthorized” account, otherwise no problems

---

<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:** [May 3, 2005, 2:42pm UTC](https://techcommunity.softwareag.com/t/sort/59953/8 "2005-05-03T14:42:28Z")

</div>

> [@WoWi](#):
>
> Tried it again, works just perfect for me, I revceive the very same NAT1500 when I try to sort from an “unauthorized” account, otherwise no problems

But user “sag” should be authorized…  
The crazy thing is:

- Even as “root” I got a NAT1500
- If I set TMP\_PATH to a non-existing directory, I’ll get a Natural startup error.

I’m shrugging, too. But anyway: Thanks for your help.

---

<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:** [May 3, 2005, 3:01pm UTC](https://techcommunity.softwareag.com/t/sort/59953/9 "2005-05-03T15:01:34Z")

</div>

Never rely on what you think should be with UNIX / LINUX 😉

Go to /sag/nat/v61110 and issue ls -l, what does it show for the tmp directory ?

---

<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:** [May 3, 2005, 3:09pm UTC](https://techcommunity.softwareag.com/t/sort/59953/10 "2005-05-03T15:09:42Z")

</div>

To make sure you are properly authorized, proceed to /sag/nat/v61110/tmp and issue something like touch xyz.txt, if this fails …

---

<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:** [May 3, 2005, 3:25pm UTC](https://techcommunity.softwareag.com/t/sort/59953/11 "2005-05-03T15:25:06Z")

</div>

> [@WoWi](#):
>
> Never rely on what you think should be with UNIX / LINUX 😉
> 
> Go to /sag/nat/v61110 and issue ls -l, what does it show for the tmp directory ?

Believe me! Everything is OK with the directory:

```auto
ls -ld tmp
drwxrwxrwx 2 sag sag 12288 Mai 3 03:38 tmp
```

I tried out /tmp (a tmp-directory for every user) and a new directory /sag/tmp.

But another thing: In my desperation, I tried to produce the same error with natural for Windows. In that environment TMP\_PATH is definitely NOT the directory for temporarly Natural-Files. It is %TMP%. You can set TMP\_PATH to a directory where you got no writing/reading right. That doesn’t bother natural…

But natural for Linux has another behaviour. $TMP doesn’t seem to have any effects…

---

<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:** [May 3, 2005, 3:27pm UTC](https://techcommunity.softwareag.com/t/sort/59953/12 "2005-05-03T15:27:11Z")

</div>

> [@WoWi](#):
>
> To make sure you are properly authorized, proceed to /sag/nat/v61110/tmp and issue something like touch xyz.txt, if this fails …

That was one of the first thing I’ve done…

---

<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:** [May 3, 2005, 4:49pm UTC](https://techcommunity.softwareag.com/t/sort/59953/13 "2005-05-03T16:49:54Z")

</div>

PROBLEM IS SOLVED!! 😃

Natural for Linux tries to create a file in TMP\_PATH with the following name:

[Username]\_[etid]\_33.SAG

I don’t know the meaning of “33”…

But the PROBLEM is: My user-assigned ETID contains a slash. And then, NAT1500 occurs while sorting.

I tried out all other LINUX-metacaracters (star, brackets, semicolon, …) - no problem at all. Even NEWLINE works. Only the simple slash causes a problem.

---

<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:** [May 3, 2005, 5:13pm UTC](https://techcommunity.softwareag.com/t/sort/59953/14 "2005-05-03T17:13:46Z")

</div>

This makes sense, because the “simple slash” is the “direcory delimiter”, everything from /sag/nat/v61110/tmp/ to the slash within the ETID will be interpreted as a directory name …

---

<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:40pm UTC](https://techcommunity.softwareag.com/t/sort/59953/15 "2021-04-02T14:40:09Z")

</div>

Closed on April 2, 2021, 2:40pm UTC


