Created On:  2010-03-23

Problem:

Using something like cron jobs or some other type of scheduler, which runs multiple mfsort routines at the same time, returns return-code =8.  The problem is that return-code=8 is set by SYSOUT being locked.  To run the sorts concurrently you'll need to start each sort in a different directory.

Resolution:


During a sort or merge operation, mfsort uses temporary work files located in either the default tmp directory or in the
directory specified by the TMPDIR environment variable.

During the sort operation - mfsort copies all the records from each of the input files into the temporary working directory.  The work files are then sorted or merged according to its key description.  After being sorted or merged in the work files, the records are copied to each of the output files.  The error occurs when using the same temporary working directory that sorts the file.

To randomly assign the temporary working directory to each of the mfsort processes, you can use the following:

1. export TMPDIR=MFSORTwrk_$RANDOM
2. execute the multiple mfsort processes
3. rm –r $TMPDIR

Incident #2436633