There’s no difference between the way QTEMP works in batch to interactive. The QTEMP library is unique to a job – it is created when the job starts and is removed when the job ends. If you submit a job – the submitted job is a new job and will have a new QTEMP library.
Interactive QTEMP is for a session and Batch QTEMP is for a Job.
I believe that we’ve got it …
Each job has a unique, seperate, and protected QTEMP library.
Each jobs QTEMP library can contain the objects that that job puts into it.
When a job ends, that jobs QTEMP library and all it’s contents are wiped out by the system.
And then the additional question — is the file created in QTEMP memory resident?
And the answer is — probably not — especially if it’s large — the system manages this.
And if you want to put a file in memory (if and only if you have enough available memory) you can use command SETOBJACC.