File sort using qshell (this time with tags)

23730 pts.
Tags:
AS/400
Database
IBM DB2
Linux
Qshell
Unix shells
Hi, I'm trying to use qshell to do a sort of a (non-keyed) DB2 database file to remove duplicate records. I use the following command :- sort -u /QSYS.LIB/$1.LIB/$2.FILE/$3.MBR | cat > /QSYS.LIB/$1.LIB/$2.FILE/$3.MBR Where $1 = Library name, $2 = File name, $3 = Member name. The command does a sort, removing duplicate records, and replaces the data in the original file with the sorted version of the data. This works fine when I try it with a small test file. When I try this with a larger test file I get the following error in the qshell :- 001-0055 Error found creating file ....... Resource busy. I'm running this on a machine with plenty of capacity, so I don't think that's an issue here. I think that the cat is starting to write the output before all the input has been read by the sort. Is there a nice way around this without sorting to another file first? Eventually I'll need to use this with some very large files. I've already tried using a command substitution for the sort :- $(sort -u /QSYS.LIB/$1.LIB/$2.FILE/$3.MBR) | cat > /QSYS.LIB/$1.LIB/$2.FILE/$3.MBR But this didn't seem to make any difference. Thanks in advance for any help, Martin Gilbert.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following