Saturday, March 27, 2010

AS400 SBMJOB examples

Examples for as400 SBMJOB

Example 1: Submitting an as400 Job

SBMJOB JOB(SPECIAL) JOBD(MYLIB/MYJOBD)
CMD(CALL MYPROG)
This as400 sbmjob command causes the job named SPECIAL to be submitted. Most of the attributes for the job are taken from the job description MYJOBD, or the job that is currently running, except for the command. The CALL command is placed on the submitted job's message queue so that the program MYPROG can be called and run later.

Example 2: Submitting an as400 Job

SBMJOB JOB(PAYROLL) JOBD(PAYROLL) INQMSGRPY(*RQD)
This as400 sbmjob command submits a job named PAYROLL to the system. All the information needed for this job (such as the job queue and routing data but not the inquiry message control value) is contained in the job description PAYROLL, or the job that is currently running. The library list in effect for the job issuing this command is used to find the job description. All inquiry messages sent during running of this job requires the receiver of the inquiry message to reply.

Example 3: Submitting an as400 Job to a Job Queue

as400 subsystem

SBMJOB JOBD(*USRPRF) JOB(COPY12) JOBQ(NIGHTQ)
CMD(CPYF FILEA FILEB)
This as400 sbmjob command submits the job COPY12, which uses the job description in the user profile of the submitting job, to the job queue NIGHTQ. The CMD parameter provides the CL command necessary for the job to run. An as400 sbmjob command such as this might be used to copy the file at night while the system is unattended.

No comments:

Post a Comment