sort: 0653-657 A write error occurred while sorting.

Hi
I am trying to sort a file of 88075743B size. I am doing some processing on the file and after the processing is done; I get 2 files temp1 and temp2. I need to combine both these files as one and this final file should be sorted on fields 1 and 2. Space is the delimiter between fields. Record length of the file is 2105.

I am sorting on temp1 and then merging temp2 with that. The commands I am using are:

sort -n -t ' ' +0 -1 $temp1 | cat > $input_file
sort -m -n -t ' ' +0 -1 $temp2 $input_file > $sort_temp

I am getting the 2 temp files sorted individually but the final file ($sort_temp) is not sorted.

If I try sort command directly without any merge; I get this error:

sort: 0653-657 A write error occurred while sorting.

Could some one tell me where I am going wrong and what should be the correct command?

Thanks

Are you trying to write into the file directly that you are currently sorting?

Anyway please post a short excerpt of the input and desired output if help on sorting itself is needed too.

---------- Post updated at 10:18 AM ---------- Previous update was at 10:18 AM ----------

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

Please state which IBM Operating System and version you have and which shell your are using. Can you post the output from "set" (removing anything private) and also state the free disc space in /tmp (or wherever you put temporary files).

---------- Post updated 10-16-09 at 13:59 ---------- Previous update was 10-15-09 at 22:27 ----------

Assuming you have a modern sort with "-k" parameters the whole process can be achieved in one sort:

sort -k 1n,1n -k 2n,2n ${temp1} ${temp2} > ${sort_temp}

If you have insufficient disc space for sort work files consider a "-T" parameter to "sort".