SORT

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

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.

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… :?:

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…

:frowning:

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

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

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.

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

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

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

Believe me! Everything is OK with the directory:

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…

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

PROBLEM IS SOLVED!! :smiley:

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.

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 …