Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AS400: which command was used on sbmjob?

707 views
Skip to first unread message

alon...@gmail.com

unread,
Apr 12, 2016, 3:20:23 AM4/12/16
to
Hi,
On AS400, I use WRKACTJOB to get a list of jobs.
How can I find the command (or CL..) that was originally used when the job was submitted?
(I'm new in AS400. I come from IBM MF. in MF you can view the source JCL of a certain job in a queue. I'm looking for something similar in AS400).

Thank You,
Alon.

Pipewrench Peterson

unread,
Apr 12, 2016, 1:12:03 PM4/12/16
to
Unless there is an API that can be called to submit a job, every job
submission method of which I'm aware uses the SBMJOB (Submit Job)
command. The SBMJOB command can be entered manually at a command line,
or called from an application program. In addition, the basic IBM job
scheduler (WRKJOBSCDE) and the IBM advanced job scheduler (WRKJOBJS)
both invoke the SBMJOB command to submit scheduled jobs.

If you know of a batch job that created a job log, look at the job log
spool file. Near the top of the job log you should see a reference to
message CPI1125. The first level message text will read "Job
nnnnnn/uuuuuuuuuu/jjjjjjjjjj submitted, where 'nnnnnn' is a six-digit
job number, uuuuuuuuuu is a (up to) 10 character user name, and
jjjjjjjjjj is a (up to) 10 character job name. In the second level text
below, you'll see in the second sentence "Job
nnnnnn/uuuuuuuuuu/jjjjjjjjjj was started using the Submit Job (SBMJOB)
command with the following job attributes:", followed by the attributes.

There's another less commonly used method to submit batch jobs, SBMDBJOB
(Submit Database Job). In that method, you specify a source file that
contains a //BCHJOB statement at the top, followed by one or more CL
commands, and ending with a //ENDBCHJOB command. (This resembles z/OS
JCL a little.) If the job generates a job log, you won't see any direct
reference to the SBMDBJOB command in it, but you should see the //BCHJOB
command.

Now I recall there are some other obscure job types that I have never
used. You can see them with from the job commands menu. Enter GO
CMDJOB at a command line, and scroll until you find the various SUBMIT
commands. In addition to SBMDBJOB and SBMJOB, you'll see SBMFNCJOB
(Submit Finance Job), SBMJOBJS (Submit Job using Job Scheduler - this
uses the advanced IBM scheduler, mentioned above), SBMNETJOB (Submit
Network Job), and SBMRJEJOB (Submit RJE (Remote Job Entry) Job). I
don't know if these use SBMJOB under the covers or not.

CRPence

unread,
Apr 12, 2016, 8:52:59 PM4/12/16
to
On 12-Apr-2016 01:20 -0600, alon...@gmail.com wrote:
>
> On AS400, I use WRKACTJOB to get a list of jobs. How can I find the
> command (or CL..) that was originally used when the job was
> submitted?
> (I'm new in AS400. I come from IBM MF (Main Frame). in MF you can
> view the source JCL of a certain job in a queue. I'm looking for
> something similar in AS400).

From Work With Active Jobs (WRKACTJOB) the "Function" column may
provide what is of interest, otherwise the option 5=Display (DSPJOB)
followed by option 10=Display Job Log (DSPJOBLOG) may.

--
Regards, Chuck

Obelix

unread,
Apr 13, 2016, 4:11:40 AM4/13/16
to
Il 12/04/2016 09:20, alon...@gmail.com ha scritto:
> How can I find the command (or CL..) that was originally used when the job was submitted?
Your question is not clear. As other stated, mainly way (quite
exclusive) to submit a job is via a SBMJOB cmd, and FWIK you have no way
to know which program launched the command.

If, instead, you want to know which job launched that command, you may
use the QUSRJOBI API format jobi0300 to get the Submitter's job info.

HTH.

Mike

unread,
Apr 13, 2016, 2:33:33 PM4/13/16
to

"Pipewrench Peterson" <p...@ua.org> wrote in message
news:B%9Py.974$JQ7...@fx40.iad...
Alon,

The above was an excellent response to your question.

However, since you are a mainframe guy you may be looking for the
equivalent of a JCL procedure when in fact the job stream is compiled
into a CL program. |

If that is what you are looking for, you can use the RTVCLSRC command
to de-compile the CL program.

Mike



Buck

unread,
Apr 13, 2016, 9:17:27 PM4/13/16
to
The normal way is to look at the job log, but as pointed out, often the 'JCL' is stored inside a CL program. Finding the source code for a CL program is not difficult for those of us who have done it a few times, but the steps for a beginner may seem intimidating.

In brief:
DSPPGM. Look for the source file, library, and member name
DSPPFM. Press F4 to prompt. Fill in the source file, library and member name. Press Enter. This is the source code for that program.

SBMJOB /is/ the usual way to submit a job but SBMDBJOB is another. Further, a newcomer to IBM i may not realise that /all/ work on the system is a job, including interactive work, ie terminals. Alon didn't mention what subsystem his job of interest is running in; we've all assumed QBATCH, but it could be QINTER or QUSRWORK (QZDASOINIT, anyone?) The point is that work management is more than batch jobs.

Alon: The current hardware is POWER 7 or POWER 8. The name of the current operating system is IBM i. I don't say this to be pedantic. If you want to search the web for current information, you will want to use the actual name of the system. The IBM references are found in the Knowledge Center: http://www.ibm.com/support/knowledgecenter/ssw_ibm_i/welcome

--buck
0 new messages