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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sort: 0653-657 A write error occurred while sorting.
# 1  
Old 10-15-2009
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:
Code:
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:
Code:
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

Last edited by zaxxon; 10-15-2009 at 05:18 AM.. Reason: code tags
# 2  
Old 10-15-2009
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 [code] and [/code] 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
# 3  
Old 10-16-2009
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:

Code:
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".
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error occurred during initialization of VM

Hi , I was invoking a sh file using the nohup command. But while invoking, I received a below error. Error occurred during initialization of VM Unable to load native library: /u01/libjava.so: cannot open shared object file: No such file or directory . Could you please help out. Regards,... (2 Replies)
Discussion started by: Kamal1108
2 Replies

2. AIX

0511-193 An error occurred

Hi, When i am trying to read data from tape cassette its giving below error: tar tvf /dev/rmt0 "tar: 0511-193 An error occurred while reading from the media. A system call received a parameter that is not valid." OS: - AIX 6.1 Tape Library : - IBM TS3100 Tape Cassette : - Ultrium LTO... (1 Reply)
Discussion started by: arunmistry
1 Replies

3. OS X (Apple)

Sorting scientific numbers with sort

Hey everybody, I'm trying to sort scientific numbers in a descending order using the command sort -gr <file>. It works fine on a Linux-Server, but doesn't on my macbook pro with OS X 10.10.3 (Yosemite). I tried to sort the following: 6.38e-10 6.38e-10 1.80e-11 1.00e-10 1.48e-12 And... (9 Replies)
Discussion started by: plebs
9 Replies

4. Solaris

Error occurred while making the net-snmp 5.4.4 on Solaris 5.10 version.

Hi all, Error occurred while making the net-snmp-5.4.4 on Solaris 5.10 version. Environment - Solaris 5.10-x86 - Net-SNMP-5.4.4.tar.gz - Path (/etc/profile) PATH=/usr/local/bin:$PATH export PATH LD_LIBRARY_PATHUSR=/usr/ccs/bin: export LD_LIBRARY_PATH Error01 - summary ***... (3 Replies)
Discussion started by: ziosnim
3 Replies

5. Red Hat

KusuDB: Operational Error occurred when connecting to the DB

I have RHEL5.3 that is with the Platform Cluster Manger PCM installation. on master node. Unfortunately some files were deleted from the /var directory and then the postgresql service couldn't start. I have deleted, rm -rf /var/lib/pgsql/data and started the service again now the service is running... (1 Reply)
Discussion started by: ahsanpmd
1 Replies

6. UNIX for Dummies Questions & Answers

Sort : Write Error occured while merging

Dear Friends, I am sorting the file which contain 55Lakhs of records while Sorting i am facing issues Sort :0653-657 Write Error occured while merging Could you please any one tell me how to overcome this problem Thanks in advance (5 Replies)
Discussion started by: i150371485
5 Replies

7. Shell Programming and Scripting

Sorting Date Field with Sort -k :/

SOLVED : (17 Replies)
Discussion started by: Glitch100
17 Replies

8. UNIX for Dummies Questions & Answers

sorting numbers with sort -n

Looking for help for sort, I learned that for sorting numbers I use: sort -n but it seems that that is not enough when you have numbers like 0.2000E+7 for example, sort -n will not worry about the E+7 part, and will just sort the numbers like 0.2000. Exapmle: cat example.txt .91000E+07... (9 Replies)
Discussion started by: cosmologist
9 Replies

9. Shell Programming and Scripting

grep only last occurred error in error.log,

hi folk i need your help to find one logic.... i have error log same as any other error logs which get populated by no of events and errors... but i need to grep the last occured errors.. which cant be duplicate. here is my script. ======================== #!/usr/bin/ksh grep -i... (3 Replies)
Discussion started by: tapia
3 Replies

10. Red Hat

rhn_register A socket error occurred

All, I'm getting the following error while I try to register the server to connect the redhat network for the updates. rhn_register updateLoginInfo() login info rhn_register A socket error occurred: (111, 'Connection refused'), attempt #1 rhn_register A socket error occurred: (111,... (6 Replies)
Discussion started by: s_linux
6 Replies
Login or Register to Ask a Question