When running a script that contains a USS command with a pipe to the "sort" the following error can occur:
sort: FSUM7081 tempnam() error
CEE5213S The signal SIGPIPE was received.
The script contains a command like below:
tail -10000 /path/filename ...... | sort -u
OPS/MVS 14.0
The sort command was allocating more storage than the amount that was available.
Using the -y directive to limit the amount of memory used by the sort command solved this problem. From IBM documentation:
–y[n]Restricts the amount of memory available for sorting to n KB of memory (where a KB of memory is 1024 bytes). If n is missing, sort chooses a reasonable maximum amount of memory for sorting, dependent on the system configuration. sort needs at least enough memory to hold five records simultaneously. If you try to request less, sort automatically takes enough. When the input files overflow the amount of memory available, sort automatically does a polyphase merge (external sorting) algorithm, which is, of necessity, much slower than internal sorting. n must be at least 2. n has a maximum value of 1024 and a default value of 56.
For example:
tail -10000 /path/filename ...... | sort -u -y
According to the reference above, using -y without a number makes sort choose a reasonable maximum amount of memory.