Hi,
How can we get details of a job which is there in QSYSOPR and job details of a specific job whose details we have in terms of jobname, jub number and user name?
searching in QSYSOPR seems quite troublesome by doing page done again and again and carefully checking where our job is and to find it out from there.
so i found this sql query "SELECT * FROM TABLE(QSYS2.JOB_INFO()" but it's also not showing that job which is there in QSYSOPR so is there any other SQL query to get the desired job's details here?
also does QSYSOPR has all the joblogs ? what about the jobs which gets completed in the system and we are not able to find there joblog as they are completed and no longer active in the system.
Thanks much....
How to get job details which is there in QSYSOPR
Re: How to get job details which is there in QSYSOPR
Welcome to the IBM i. It seems you might be new to the system.
I am not sure what you mean when you say a job is "...in QSYSOPR...". QSYSOPR is a user profile or it is a message queue. I will assume you mean the message queue. And you must mean there is a message about a job in the QSYSOPR message queue - there is no way I know of that "...a job is in QSYSOPR..."
The QSYSOPR MSGQ does not have any job logs - those are for each job. I suggest you get IBM's documentation about system operations, you can download it here -
https://www.ibm.com/docs/en/ssw_ibm_i_7 ... al2pdf.pdf
Look at the chapter on IBM i Concepts in there, at the Messages section. QSYSOPR is mentioned several times in there, both as the user profile and as the message queue. In the Messages section, it says the following: "The message queue for the QSYSOPR profile is particularly important because the system sends many messages about job completion and system status to the QSYSOPR message queue."
Now if you know the job name, number, and user - there is a command to see everything - DSPJOB - you can also specify those items in parameters for the JOB_INFO table function. You should look at IBM's documentation for JOB_INFO to learn more - you can Google for it.
Regards
Vern
I am not sure what you mean when you say a job is "...in QSYSOPR...". QSYSOPR is a user profile or it is a message queue. I will assume you mean the message queue. And you must mean there is a message about a job in the QSYSOPR message queue - there is no way I know of that "...a job is in QSYSOPR..."
The QSYSOPR MSGQ does not have any job logs - those are for each job. I suggest you get IBM's documentation about system operations, you can download it here -
https://www.ibm.com/docs/en/ssw_ibm_i_7 ... al2pdf.pdf
Look at the chapter on IBM i Concepts in there, at the Messages section. QSYSOPR is mentioned several times in there, both as the user profile and as the message queue. In the Messages section, it says the following: "The message queue for the QSYSOPR profile is particularly important because the system sends many messages about job completion and system status to the QSYSOPR message queue."
Now if you know the job name, number, and user - there is a command to see everything - DSPJOB - you can also specify those items in parameters for the JOB_INFO table function. You should look at IBM's documentation for JOB_INFO to learn more - you can Google for it.
Regards
Vern
Re: How to get job details which is there in QSYSOPR
Thanks but when i searched my desired job using ;SELECT * FROM TABLE(QSYS2.JOB_INFO() i could not find my job there?
i did not mention where clause in this query because there were very few jobs as output of above SQL query whereas I was expecting there would have been many jobs , if there were too many jobs as outut of this SQL query then i would have tried filtering the records based on where clause but the output it showed i did not find my job there.even though if it would have shown the output , would it have shoown the details i am looking for like who responded to that job?, what action was taken when it went in MSGW at what time at what date ? would this SQL query have captured those details? or that can only be found in DSPJOB command, if only in DSPJOB command then how long it remains over there and when it gets deleted automatically since the time it's details are captured inside spool file for that job?
Thanks much..
i did not mention where clause in this query because there were very few jobs as output of above SQL query whereas I was expecting there would have been many jobs , if there were too many jobs as outut of this SQL query then i would have tried filtering the records based on where clause but the output it showed i did not find my job there.even though if it would have shown the output , would it have shoown the details i am looking for like who responded to that job?, what action was taken when it went in MSGW at what time at what date ? would this SQL query have captured those details? or that can only be found in DSPJOB command, if only in DSPJOB command then how long it remains over there and when it gets deleted automatically since the time it's details are captured inside spool file for that job?
Thanks much..
Re: How to get job details which is there in QSYSOPR
Also reply given to job in MSGW, I didn't find inside DSPJOB, i found it in DSPMSG QSYSOPR.
Thanks
Thanks
Re: How to get job details which is there in QSYSOPR
Hi,
Could someone please help to answer my queries here ?
Also, could someone please help by modifying this SQL query so that I should be able to find out my job which was earlier in 'MSGW' but after providing appropriate reply to that job it was no longer in MSGW. But I want to capture all those details using this standard IBM i SQL query but I am not sure how to make this SQL query work to find me out my desired job details here( because when i do F4 while selecting library and fields and other parameters then i get confused so many options there which one to choose to get my desired job detail here as simply when i ran this sql query as it is it did not show the job which i was looking for) so request to get assistance regarding the same if anyone could please help me out to find that by modifying this SQL query regarding the ame please then it would be very much helpful.
Thanks much...
Could someone please help to answer my queries here ?
Also, could someone please help by modifying this SQL query so that I should be able to find out my job which was earlier in 'MSGW' but after providing appropriate reply to that job it was no longer in MSGW. But I want to capture all those details using this standard IBM i SQL query but I am not sure how to make this SQL query work to find me out my desired job details here( because when i do F4 while selecting library and fields and other parameters then i get confused so many options there which one to choose to get my desired job detail here as simply when i ran this sql query as it is it did not show the job which i was looking for) so request to get assistance regarding the same if anyone could please help me out to find that by modifying this SQL query regarding the ame please then it would be very much helpful.
Thanks much...
-
- Site Admin
- Posts: 872
- Joined: Sun Jul 04, 2021 5:12 am
Re: How to get job details which is there in QSYSOPR
I have no clue what you are trying to do or why.
Re: How to get job details which is there in QSYSOPR
Hi,
I simply want to tracj all failed, completed jobs using standard IBM i SQL query "SELECT * FROM TABLE(QSYS2.JOB_INFO() " but not sure why the jobs which i can see using DSPJOB command after selecting 1 then option 4 to view spool files from ther we check QPJOBLOG where we have most of the details related to that job.
So simply if i have job name , number and user name and the same when i am providing this in this SQL query i can not find it whereas in DSPJOB it shows. I want to see using this SQL query but even after supplying same job details it does not show in the result of this SQL query why? what is wrong with my SQL query here?
how long does this SQL query hold the result of this job log ? who holds longer time DSPJOB or this SQL query ?
Thanks much..
I simply want to tracj all failed, completed jobs using standard IBM i SQL query "SELECT * FROM TABLE(QSYS2.JOB_INFO() " but not sure why the jobs which i can see using DSPJOB command after selecting 1 then option 4 to view spool files from ther we check QPJOBLOG where we have most of the details related to that job.
So simply if i have job name , number and user name and the same when i am providing this in this SQL query i can not find it whereas in DSPJOB it shows. I want to see using this SQL query but even after supplying same job details it does not show in the result of this SQL query why? what is wrong with my SQL query here?
how long does this SQL query hold the result of this job log ? who holds longer time DSPJOB or this SQL query ?
Thanks much..
-
- Site Admin
- Posts: 872
- Joined: Sun Jul 04, 2021 5:12 am
Re: How to get job details which is there in QSYSOPR
I assume "tracj" is a typo for "track".c21 wrote: ↑Tue Jul 23, 2024 7:36 am I simply want to tracj all failed, completed jobs using standard IBM i SQL query "SELECT * FROM TABLE(QSYS2.JOB_INFO() " but not sure why the jobs which i can see using DSPJOB command after selecting 1 then option 4 to view spool files from ther we check QPJOBLOG where we have most of the details related to that job.
You say "but not sure why the jobs which I can see..."... then describe how you are seeing them interactively... but never finish the question. Not sure why these jobs do what?
What is the status of the job? What parameters are you passing to JOB_INFO? Why are you using JOB_INFO in the first place?
How are you providing these details? This is a sophisticated function with a lot of options. Give an example.
They're the same. The info isn't stored in the routine, it's stored in the operating system. Both DSPJOB and the SQL routine are retrieving it from the operating system when you ask for it.
But they serve completely different purposes. DSPJOB is meant to display a single job interactively. JOB_INFO is meant to provide a list of jobs that match a given filter criteria, and return it's output to an SQL query.
Re: How to get job details which is there in QSYSOPR
yes it was 'track', sorry for typo.
i meant the jobs which i can see using DSPJOB command i can not see using sql query i mentioned and status of these jobs is in OUTQ.
and i can see their spool files when i do DSPJOB--then option 5 then option 4 to see spool file and in spool file also QPJOBLOG type spool file tells details about that job whether it ended with status code '0' or not. like these details and when it was submitted at what date and what time in the particular system (or subsystem etc.)
I want to track all these details using SQL query so i am using "SELECT * FROM TABLE(QSYS2.JOB_INFO()" and in my where clause in my sql i am supplying job number, job name and username but SQL query is not showing any result here where as DSPJOB shows that result.
what is wrong in my sql query here?
"JOB_INFO is meant to provide a list of jobs that match a given filter criteria and return it's output to an SQL query."-->
what's wrong in my filter criteria above when i am providing same job name, job number and user name in my sql query which i can see inside dspjob for that job and at the time when that particular job was in MSGW also so i am providing basic details of qualified job name, job number and user name correct only in my this SQL query despite that it does not show my desired job information here so what is wrong with my SQL query.
I am using this SQL query because I want to explore this way as well and want to know what all parameters are captured inside this SQL query for the failed/completed jobs.one more reason to use this SQL query is that if it keeps all the detils then we can have a log of all jobs (failed,ran successfully at what date, time etc. )which otherwise would be difficult using DSPJOB or other command ( I am not sure may be DSPJOBLOG or DSPLOG or WRKJOB may have that log)
Thanks so much...
i meant the jobs which i can see using DSPJOB command i can not see using sql query i mentioned and status of these jobs is in OUTQ.
and i can see their spool files when i do DSPJOB--then option 5 then option 4 to see spool file and in spool file also QPJOBLOG type spool file tells details about that job whether it ended with status code '0' or not. like these details and when it was submitted at what date and what time in the particular system (or subsystem etc.)
I want to track all these details using SQL query so i am using "SELECT * FROM TABLE(QSYS2.JOB_INFO()" and in my where clause in my sql i am supplying job number, job name and username but SQL query is not showing any result here where as DSPJOB shows that result.
what is wrong in my sql query here?
"JOB_INFO is meant to provide a list of jobs that match a given filter criteria and return it's output to an SQL query."-->
what's wrong in my filter criteria above when i am providing same job name, job number and user name in my sql query which i can see inside dspjob for that job and at the time when that particular job was in MSGW also so i am providing basic details of qualified job name, job number and user name correct only in my this SQL query despite that it does not show my desired job information here so what is wrong with my SQL query.
I am using this SQL query because I want to explore this way as well and want to know what all parameters are captured inside this SQL query for the failed/completed jobs.one more reason to use this SQL query is that if it keeps all the detils then we can have a log of all jobs (failed,ran successfully at what date, time etc. )which otherwise would be difficult using DSPJOB or other command ( I am not sure may be DSPJOBLOG or DSPLOG or WRKJOB may have that log)
Thanks so much...
Re: How to get job details which is there in QSYSOPR
Could someone please reply?
Thanks...
Thanks...