when using QSH, your requests are federated to a separate job.
this means that your local QTEMP is not the same as the QTEMP in that particular job.
So it won’t work.
as you say, you have to use a named library.
Register Hereor login if you are already a member