• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Scheduling a Job to Run More than Once a Day

    July 12, 2002 Timothy Prickett Morgan

    Hey, Ted:

    How can I schedule a job to run more than once a day? The Add Job Schedule Entry (ADDJOBSCDE) command has only the frequency options of *monthly, *weekly, *once.

    — Rocky

    One option is to install IBM‘s licensed program product 5722-JS1 (Job Scheduler for iSeries) and use the Add Job using Job Scheduler (ADDJOBJS) command. If I am not mistaken, IBM charges extra for this job scheduler.

    If you want to use ADDJOBSCDE instead, write a CL program to schedule the jobs throughout the day. Let the job scheduler execute your CL program.

    For example, assume you want to run a job on the hour from 7:00 AM to 5:00 PM (0700 to 1700 hours), Monday through Friday. Your CL program, which I’ll call SKEDPGM, looks something like this:

    PGM                                                   
                                                          
       DCL &SKEDTIME     *CHAR 4                          
       DCL &TIME         *DEC  4                          
       DCL &BEGTIME      *DEC  4  VALUE(0700)             
       DCL &ENDTIME      *DEC  4  VALUE(1700)             
       DCL &INCREMENT    *DEC  4  VALUE(0100)             
                                                          
       MONMSG CPF0000 EXEC(GOTO ERROR)                    
                                                          
       CHGVAR &TIME &BEGTIME                              
    NEXTSKED:                                             
       CHGVAR &SKEDTIME &TIME                             
       SBMJOB     CMD(CALL SOMEPGM) + 
                    JOB(SOMEJOB) +                      
                    SCDTIME(&SKEDTIME)                    
       IF (&TIME *LT &ENDTIME) DO                         
          CHGVAR &TIME (&TIME + &INCREMENT)               
          GOTO NEXTSKED  
       ENDDO             
       RETURN            
                         
    ERROR:               
       /* DO WHATEVER */ 
                         
    ENDPGM               
    

    Notice the SCDTIME parameter on the Submit Job (SBMJOB) command. This schedules the job to run at a later time.

    Notice also that the expression that increments the &TIME variable is decimal arithmetic, not time arithmetic. If you are scheduling a job to run every ten minutes, for example, you will have to increment the hour and reset minutes to zero when minutes reaches a value of 60.

    Have the job scheduler run this program before 7:00 AM:

    ADDJOBSCDE JOB(MYJOB) +
               CMD(CALL PGM(SKEDPGM)) +
               FRQ(*WEEKLY) +
               SCDDATE(*NONE) +
               SCDDAY(*MON *TUE *WED *THU *FRI) +
               SCDTIME(003000)
    

    — Ted

    Sponsored By
    TRAMENCO

    Introducing a New Source for Training and Mentoring. Follow this link to a vital new source for how-to technical information: www.tramenco.com.

    Unlike companies that offer training as an afterthought, The Training and Mentoring Company (Tramenco) is dedicated to just one thing: Advancing your career by giving you the skills you need to solve real-world business problems.

    You get the best information from the world’s leading experts–Howard Arner, Kelly Conklin, Don Denoncourt, Susan Gantner, Skip Marchesani, Glen Marchesani, Shannon O’Donnell, Craig Pelke, and Richard Shaler.

    Choose from a menu of training options to fit your needs: onsite seminars, public seminars, mentoring, consulting, books, CBTs, and Web-based training.

    And make plans to attend the 2002 iSeries Connection Conference, the multi-day, multi-track conference that was the only sold-out iSeries training event this year, co-sponsored by the Education Connection and Tramenco.

    For more information about Tramenco’s career enhancing opportunities, call (800) 421-8031 or go to www.tramenco.com.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 52 -- July 12, 2002

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Delete Badly-Named OS/400 IFS Files, Take Two Readers Insights and Feedback: Dealing with Record Locks

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 52

This Issue Sponsored By

    Table of Contents

    • Reader Feedback and Insights: Service Program Catch-22 Simplified
    • Setting TCP/IP Server Autostart Parameters as a Group
    • Scheduling a Job to Run More than Once a Day

    Content archive

    • The Four Hundred
    • Four Hundred Stuff
    • Four Hundred Guru

    Recent Posts

    • Meet The Next Gen Of IBMers Helping To Build IBM i
    • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
    • Will Independent IBM i Clouds Survive PowerVS?
    • Now, IBM Is Jacking Up Hardware Maintenance Prices
    • IBM i PTF Guide, Volume 27, Number 24
    • Big Blue Raises IBM i License Transfer Fees, Other Prices
    • Keep The IBM i Youth Movement Going With More Training, Better Tools
    • Remain Begins Migrating DevOps Tools To VS Code
    • IBM Readies LTO-10 Tape Drives And Libraries
    • IBM i PTF Guide, Volume 27, Number 23

    Subscribe

    To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

    Pages

    • About Us
    • Contact
    • Contributors
    • Four Hundred Monitor
    • IBM i PTF Guide
    • Media Kit
    • Subscribe

    Search

    Copyright © 2025 IT Jungle