Home > Ask the AS/400 Experts > iSeries Backup and Recovery Questions & Answers > Advanced Job Scheduler help
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Advanced Job Scheduler help

Ken Graap EXPERT RESPONSE FROM: Ken Graap

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 31 July 2007
I need to build a CL program to read the logs from one of my jobs in Advanced Job Scheduler (option 19). I need to monitor a process and make sure it ends with code 0. What is the IBM physical file (Qxxxx) that holds the logs for Advanced Job Scheduler jobs?

Thanks in advance.


>
EXPERT RESPONSE
The Advanced Job Scheduler (IJS) already provides several ways to monitor for job completion.
  1. Job Notification
  2. Alternate Job
  3. Displaying Job History
Job Notification:

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 . . . . . . :                                              

Alternate Job:

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
Page 1                
Date Time Message Sev Text       Program  
User Type                
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
      QIJSCEC BACKUP
8/02/06 2:28:55 IJS6008 50 Command sequence 0030 for job D_BU10 group D_BU10 sequence 01 ended in
error.
Cause . . . . . : Command to execute was: STRBKUBRM
CTLGRP(D_PRDGEN10) SBMJOB(*NO).
      QIJSCEC BACKUP
8/02/06 2:28:55 IJS6003 50 Job 268712/BACKUP/D_BU10 ended abnormally for job D_BU10 group D_BU10
sequence 01.
      QIJSLRUN BACKUP

Good luck!


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
iSeries Backup and Recovery
Changing BRMS configurations for new naming conventions for i5
Revisiting automating email for a backup joblog on AS/400
SAVF FTP on AS400 LAN: 504 Binary image transfer required for save files
Sending a message to an output file after backup completion
ASP configuration restore
Automatic email for backup job log on AS/400
Decrease iSeries downtime caused by SAVSYS backup
Adding journal tapes to the BRMS media pool on AS/400
Killing option 21 backup midsave
Transferring data via FTP on AS/400 systems

iSeries CL programming
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
How do I retrieve the source for an output queue description to put in to a CL program?
Top 10 programmer tips YTD
Ways to put QSHELL to work in your day-to-day programming life
Writing to a file from CL -- revisited
Code examples to determine future end of month based on any given date
A program to access stored text files
Slow system performance
Changing the font size

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts