This has been asked multiple times, here’s a good link that provides a solid explanation:
how to access QTEMP files in batch programs.
The *LDA is easy as these two commands can show:<pre>
CHGDTAARA DTAARA(*LDA) VALUE(‘Here”s interactive data’)
SBMJOB CMD(DSPDTAARA DTAARA(*LDA) OUTPUT(*PRINT))</pre>
The submitted job will create a spooled file that shows the data was copied from the interactive job’s *LDA to the batch job’s *LDA. The two data areas will be the same at the time SBMJOB executes. Any changes to either *LDA after that will not show up in the other *LDA.
There is no way to access the interactive QTEMP from the batch job unless some kind of inter-program communication is set up. There’s no way to be sure that the interactive QTEMP will even still exist at the time the batch job starts.