Once we changed to dinamic allocations in the sort we saw the following behavior: makes alloc of sortwkxx, then it gives B37-04 in some of them, after deletes some of the work areas and finally it makes other allocations of sortwk. This happens very frequently and with sufficient disc space. The question is why happens this and what I can do to reduce the B37.
Well, I'd question that assumption. This kind of situation is usually very site dependent and requires an analysis of specific information in order to arrive at a specific solution.
Assuming you're using DFSORT, the best way to handle it would be to open a problem report with IBM service. That way, they can collect all of the needed information and do an analysis of what exactly is happening and what to do about it.