ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Job Schedule

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Job Schedule

    Hi...A user has asked me to schedule a job to run on the 15th of each month. I've tried to add a job schedule entry, but can't find how to run a job on the same day of each month. Is anyone knows how can I do this without creating a program?...

    Thanks. PUNGKOY

  • #2
    Re: Job Schedule

    Hi pungkoy:

    Use a schedule code of "DATE" and fill in the dates

    Schedule code . . . . . . . . *DATE
    Dates of the year . . . . . . 0115 0215 0315 0415 0515 0615 0715
    0815 0915 1015 1115 1215

    Note: Dates are entered in job date format.

    Best of Luck
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

    Comment


    • #3
      Re: Job Schedule

      HI GLS400,

      Sorry for my ignorance but what command will I use to schedule this job, can't find the parameter that you were reffering in Job schedule...My OS version is V5r3 and we're planning to upgrade this in February...

      Thanks again....PUNGKOY

      Comment


      • #4
        Re: Job Schedule

        Hi pungkoy:

        1. GO JS
        2. Work with jobs (option 1) then enter
        3. option 2 (change) your job

        I'm at V5R4......I'm not sure if Job scheduler changed between V5R4 and V5R3

        Job name . . . . . . . . . . . TESTGLS Name
        Group name . . . . . . . . . *NONE Name, *NONE
        Group sequence . . . . . . . 0 Number
        Application . . . . . . . . . *NONE Name, *NONE, F4 for list
        Schedule code . . . . . . . . *DAILY Name, *DAILY, F4 for list Scheduled times . . . . . . . 0:00 0:00 0:00 0:00 0:00
        0:00 0:00 0:00 0:00 0:00
        Calendar . . . . . . . . . . . *NONE Name, *NONE, F4 for list
        Holiday calendar . . . . . . . *NONE Name, *NONE, F4 for list
        Fiscal calendar . . . . . . . *NONE Name, *NONE, F4 for list
        Days . . . . . . . . . . . . . *SUN *MON *TUE *WED *THU *FRI *SAT
        Text . . . . . . . . . . . . . *NONE
        Once you have changed the default from *Daily to *Date *sun *mon etc goes away and is replaced with "dates of the year"

        Best of Luck
        GLS
        The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

        Comment


        • #5
          Re: Job Schedule

          JS is the Advanced Job Scheduler (I believe) - an extra $ option.
          Otherwise use ADDJOBSCDE with settings as suggested by GLS400

          Comment


          • #6
            Re: Job Schedule

            Thanks Guys...either way this will not solve my problem because I dont have Advance Job Scheduler and ADDJOBSCDE don't have parameter that can schedule a job every 15th of each month...but thanks again for the reply.

            PUNGKOY

            Comment


            • #7
              Re: Job Schedule

              Simple. create a CL program to 1) execute the program you want to run 2) submit itself as a scheduled job for the next 15th of the month.

              CLP program theory: (pgm name is Ajob
              PHP Code:
              pgm

              dcl 
              &schdate *char 6

              /* retreive sysval qmonth then increment it by 1 */
              /* retreive sysval qdate
              /* then change the retreived system date month portion to the incremented month */
              /* I am not going to write this for you, you can figure it out */

              SBMJOB CMD(CALL PGM(APGM)) JOB(\APGMJOBD(URJOBDJOBQ(QPGMRSCDDATE(&schdateSCDTIME(150000)   

              call Urprogramhere

              endpgm 
              Bill
              "A good friend will bail you out of jail,
              A true friend would be sitting beside you saying,
              'Wow, that was fun.'"

              Comment


              • #8
                Re: Job Schedule

                From the Job Scheduler help text:

                *MONTHLY
                The job is submitted on the same day or days of each
                month at the scheduled time.

                If you specify *MONTHLY and a month does not contain
                the day specified for the SCDDATE parameter, the job
                is not run that month. For example, if
                SCDDATE(01/31/2004) and FRQ(*MONTHLY) are specified,
                the job is submitted on 01/31, 03/31, 5/31, 7/31,
                8/31, 10/31 and 12/31, but will not run in February, April, June, September, or November. To submit a job
                on the last day of every month, specify
                SCDDATE(*MONTHEND).

                If you specify *MONTHLY and your system or your job is
                configured to use Julian date format, the job is
                submitted to run on the day of the month that it would
                run if the system or job did not use Julian date
                format.
                I just placed my cursor on Frequency and hit F1.
                We do not have the Advanced JS, just the vanilla one. HTH

                Pete

                Comment


                • #9
                  Re: Job Schedule

                  Thanks Billw...hope you read my first message that I stated "Is anyone knows how can I do this without creating a program?"...but thanks very much for the reply but I think this is the only way that I can run the job, by creating a program.

                  Also thanks Pete..but I want to schedule the job every 15th of the month...not secont tuesday of the month or monthend or start of the month...I know there's a parameter in Job schedule that you can do this but thanks anyways...

                  Comment


                  • #10
                    Re: Job Schedule

                    As pete said: just use schdate(021509)and *monthly then it will ALWAYS run on the 15th monthly

                    Bill
                    Bill
                    "A good friend will bail you out of jail,
                    A true friend would be sitting beside you saying,
                    'Wow, that was fun.'"

                    Comment


                    • #11
                      Re: Job Schedule

                      OOOPPPS...it's my fault...thanks guys it works...

                      Comment

                      Working...
                      X