Hi,
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.
Regards,
Martin Gilbert.
.........................................
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.
Phil
______________________________________________________________________
6/10/09
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.
Phil
////////////////////
And if you want to put a file in memory (if and only if you have enough available memory) you can use command SETOBJACC.
Wilson
Last Wiki Answer Submitted: June 10, 2009 9:19 pm by philpl1jb44,630 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
This is a subject that I found a number of people starting out in os/400 misunderstand. I found it good to explain this way:
Every job you start has it’s own QTEMP library. Every interactive login and SBMJOB executed results in it’s own job, and therefore, it’s own QTEMP. For example, if you log on to 2 different 5250 screens, you have two separate QTEMP libraries defined.
QTEMP library is SESSION related – NOT job related.
When you sign on you start a session, which therefore has its own library QTEMP created and attached to it. This specific library is only visible (fx DSPLIB QTEMP) within this session. As you may understand – QTEMP is a ‘personal’ thing as long as your session is active (= until signoff).
If you run two interactive programs A and B, A may create a file in QTEMP which program B may use when run afterwards from the same session. QTEMP will be deleted with its content when you signoff the session. If you run three sessions (= 3 signon’s) you will have 3 QTEMP libraries all available only to the session that caused their existance.
A submitted job to batch (submitted from anywhere (SBMJOB, JOB-scheduler, jobq or other sources) will also get its own QTEMP, which is only (as in the interative environment described above) available to this spectacular session; – it is therefor NOT possible for anybody to look into it or use its content.
QTEMP is often used to make workfiles avaliable for use by programs run one after the other.
As QTEMP is deleted when the session ends (= you sign off), there is no need for any ‘clean up’.
QTEMP library is SESSION related – NOT job related. = NOT TRUE!
What you call a session is a JOB. If you signon multiple times you are running multiple JOBS. Each job has a unique JOB NUMBER. QTEMP is unique per JOB.
To expand on the QTEMP being JOB dependent. It’s also possible to have one signon running multiple jobs (as group jobs) each with their own QTEMP library.
To extend this discuss further, can anyone tell me if a file created in QTEMP is stored on a disk or in memory? I’m curious if it is a memory location, aka, better performance.
This is a subject that I found a number of people starting out in os/400 misunderstand. I found it good to explain this way:
Every job you start has it’s own QTEMP library. Every interactive login and SBMJOB executed results in it’s own job, and therefore, it’s own QTEMP. For example, if you log on to 2 different 5250 screens, you have two separate QTEMP libraries defined.
QTEMP library is SESSION related – NOT job related.
When you sign on you start a session, which therefore has its own library QTEMP created and attached to it. This specific library is only visible (fx DSPLIB QTEMP) within this session. As you may understand – QTEMP is a ‘personal’ thing as long as your session is active (= until signoff).
If you run two interactive programs A and B, A may create a file in QTEMP which program B may use when run afterwards from the same session. QTEMP will be deleted with its content when you signoff the session. If you run three sessions (= 3 signon’s) you will have 3 QTEMP libraries all available only to the session that caused their existance.
A submitted job to batch (submitted from anywhere (SBMJOB, JOB-scheduler, jobq or other sources) will also get its own QTEMP, which is only (as in the interative environment described above) available to this spectacular session; – it is therefor NOT possible for anybody to look into it or use its content.
QTEMP is often used to make workfiles avaliable for use by programs run one after the other.
As QTEMP is deleted when the session ends (= you sign off), there is no need for any ‘clean up’.
QTEMP library is SESSION related – NOT job related. = NOT TRUE!
What you call a session is a JOB. If you signon multiple times you are running multiple JOBS. Each job has a unique JOB NUMBER. QTEMP is unique per JOB.
Regards,
Martin Gilbert.
To expand on the QTEMP being JOB dependent. It’s also possible to have one signon running multiple jobs (as group jobs) each with their own QTEMP library.
Regards,
Martin Gilbert.
To extend this discuss further, can anyone tell me if a file created in QTEMP is stored on a disk or in memory? I’m curious if it is a memory location, aka, better performance.