In reply to Ian Wakeling.

OK, I thought about it. I think what you were seeing was a consequence of multithreading of matrix multiplication (including outer products z=x`*y). When SAS first started multithreading SAS/IML, we started with matrix multiplication. This result makes sense if your CPU has four cores. I think when you reported this issue in 2013, you were using a version of SAS/IML for which matrix multiplication was running on 4 cores, but the J function was still single threaded. I just tried your problem using SAS/IML 14.1 (for which the J function is multithreaded) and the J function is now faster, as you would expect.