Thanks in advance.
- Job Notification
- Alternate Job
- Displaying Job History
First of all, you need to specify a "Notification Command" for IJS to use when sending messages:
My IJS configuration uses a command called SNDICM. This command is defined to IJS via the CHGNFYJS command:
Change Notification Command (CHGNFYJS)
Type choices, press Enter.
Notification command . . . . . . CMD 'QGPL/SNDICM RCP(&RCP) MSG(''&MSGTXT'')'
Once you have defined a "Notification Command" to IJS you can then utilize the preexisting fields in the IJS job definition.
For example, I have defined a job to send messages for both a *NORMAL completion and an *ABNORMAL completion.
When this job finishes properly, IJS sends a message to SYSADM "Daily Prod BU 10 finished OK"
If it finishes with errors, IJS sends a message to SYSADMCRT "Daily Prod BU 10 had errors"
Display Job S02 7/31/07 8:39:48 Remote location name . . . . : *JOBCTL Start time and date: Beginning time . . . . . . : *NONE Beginning date . . . . . . : *NONE End time and date: Ending time . . . . . . . : *NONE Ending date . . . . . . . : *NONE Maximum run time . . . . . . : *NOMAX Notification recipient normal: SYSADM Notification message . . . : Daily Prod BU 10 finished OK Notification recipient abnorm: SYSADMCRT Notification message . . . : Daily Prod BU 10 had errors Alternate job . . . . . . . : *NONE Group name . . . . . . . . : *NONE Group sequence . . . . . . :
In my example above I have specified *NONE for the Alternate Job. However, I could have specified another IJS job, and this job would only be executed when the job ends abnormally. This job could be defined to send out notification messages, start other jobs or anything else that you might want to do when a job ends abnormally.
Displaying Job History:
If you choose not to utilize the built in notification features, you can still query the IJS history log using the DSPLOGJS command.
For example the command:
DSPLOGJS PERIOD((*AVAIL *BEGIN)) SEV(20) OUTPUT(*PRINT) DETAIL(*FULL) JOB(D_BU10)
... will scan the IJS History Log and generate a report showing any message with a severity of 20 or greater for job D_BU10.
Here is an example of the report. (Sample re-created by editorial team may differ from actual log output.)
|5722JS1||V5R3MO||Job Scheduler Log||S02||7/31/07||8:58:28|
|8/02/06||2:28:55||BRM10A1||40||Control group D_PRDGEN10 type *BKU completed with errors.
Cause . . . . . : Control group D_PRDGEN10 type *BKU completed
processing but errors were detected. This may be caused from
objects not being saved.
Recovery . . . : See previously listed messages to determine
possible causes for the errors and for any objects not saved
|8/02/06||2:28:55||IJS6008||50||Command sequence 0030 for job D_BU10 group D_BU10 sequence 01 ended in
Cause . . . . . : Command to execute was: STRBKUBRM
|8/02/06||2:28:55||IJS6003||50||Job 268712/BACKUP/D_BU10 ended abnormally for job D_BU10 group D_BU10
Dig Deeper on iSeries CL programming
Related Q&A from Ken Graap
IBM's iSeries Backup and Recovery manual answers many questions related to system backup and disaster recovery. Continue Reading
The BRMS Network feature allows a BRMS system to connect to other BRMS systems via a network, and enables a user to consolidate media such as backup ... Continue Reading
The only option to correct damage preventing file journaling is to use the RCLSTG command. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.