CA Workload Automation CA 7 Edition

Expand all | Collapse all

Schedule Last Sunday Except if Sunday EOM - Rollback

  • 1.  Schedule Last Sunday Except if Sunday EOM - Rollback

    Posted 01-04-2019 11:30 AM

    Trying to schedule a job to run the last Sunday of the month EXCEPT if Sunday is end of month. If Sunday is end of month I would like it to roll back to the previous Sunday. When I tried the following if worked for every Sunday except for September and December 2019, the job gets scheduled twice - 9/22/19 and 9/29/19 and 12/22/19 and 12/29/19 just want 9/29/19 and 12/29/19. March and June 2019 should roll back to previous Sunday(3/24/19 - 6/23/19) because they are Sunday EOM.

     

    ------------------ CA-7 CPU JOB SCHEDULING PARAMETER EDIT ------------------
    FUNCTION: LIST (ADD,DELETE,EXIT,FORMAT,LIST,REPL,SAVE,SR,SS)
    JOB: DO9BBAT3 SCHID: 199 SCAL: ROLL: B INDEX: 000
    DOTM LDTM SBTM ---------------------REPEAT----------------------
    0805 0001 0800 INTERVAL: 0000 TYPE: COUNT: 0000 STOP: 0000

     

    __ __ DAILY
    __ __ WEEKLY SUN: MON: TUE: WED: THU: FRI: SAT:

    __ X __ MONTHLY JAN: X FEB: X MAR: X APR: X MAY: X JUN: X
    JUL: X AUG: X SEP: X OCT: X NOV: X DEC: X
    WEEK: 4,5 DAY-OF-WEEK: SUN
    RDAY: /-0

    __ __ ANNUAL DAY:
    DEFAULT SCAL: AG
    __ __ SYMETRIC START: SPAN: SCHID-COUNT: 001

    PROGRAM: SM72 MSG-INDX: 00 -- DB.2.1-E -- 19.004 / 11:08:59
    MESSAGE: LIST FUNCTION SUCCESSFUL

     

    Calendar AG:

     

    * CALENDAR FOR YEAR 2019.
    * DAYS SUN-SAT EXCLUDING ALL NON-WORKING AGENCY HOLIDAYS.
    *
    * REFER: (SCAL19AG).
    *
    TITLE 'CALENDAR SCAL19AG '
    CALENDAR YEAR=2019,SCAL=AG,CURDATE=18004,
    SCHDAYS=(WEEKDAYS,SAT,SUN),
    NOSCHDY=(0101,0527,0704,0902,1128,1225),
    HOLIDAY=(0101,0527,0704,0902,1128,1225)
    END



  • 2.  RE: Schedule Last Sunday Except if Sunday EOM - Rollback

    Posted 10-31-2019 09:46 AM
    Hi Srosenfe,
    What I would do I would use a 7 day calendar and schedule it with 2 SCHIDs like this (notice the INDEX in the 2nd SCHID):

    FUNCTION: LIST (ADD,DELETE,EXIT,FORMAT,LIST,REPL,SAVE,SR,SS)
    JOB: SAULCCTS SCHID: 10 SCAL: ROLL: N INDEX: 000
                            DOTM LDTM SBTM ---------------------REPEAT----------------
                            1000    0100   0900   INTERVAL: 0000   TYPE:   COUNT: 0000   STOP

    __ __ DAILY
    __ __ WEEKLY SUN: MON: TUE: WED: THU: FRI: SAT:

    __ X __ MONTHLY JAN: X FEB: X MAR: X APR: X MAY: X JUN: X
                                   JUL: X AUG: X SEP: X OCT: X NOV: X DEC: X
                       WEEK: -0                          DAY-OF-WEEK: SUN
                       RDAY: /-0


    FUNCTION: LIST (ADD,DELETE,EXIT,FORMAT,LIST,REPL,SAVE,SR,SS)
    JOB: SAULCCTS SCHID: 20 SCAL: ROLL: N INDEX: -007
                            DOTM LDTM SBTM ---------------------REPEAT-----------------
                            1000   0100    0900    INTERVAL: 0000   TYPE:   COUNT: 0000   STOP:

    __ __ DAILY
    __ __ WEEKLY SUN: MON: TUE: WED: THU: FRI: SAT:

    __ X __ MONTHLY JAN: X FEB: X MAR: X APR: X MAY: X JUN: X
                                    JUL: X AUG: X SEP: X OCT: X NOV: X DEC: X
                      WEEK: /4,/5                   DAY-OF-WEEK: MON,TUE,WED,THU,FRI,SAT
                      RDAY: -0


    ------------------------------
    Saul Suarez Del Real
    TIAA-CREF
    ------------------------------



  • 3.  RE: Schedule Last Sunday Except if Sunday EOM - Rollback

    Posted 15 days ago
    I had to split into 30 and 31 days months, and February due to Leap Year.
    the logic was scheduling last and one before last SUN of the month, and excluding possible days for each case, to avoid the double running.

    February            =  not run on 28 - 29th and from 15 thru 20th, which may fall on a third SUN where the last SUN won't fall on EOM
    31 days months =  not run on 31st and from 18 thru 23rd, which may fall on a third SUN where the last SUN won't fall on EOM
    30 days months =  not run on 30th and from 17 thru 22nd, which may fall on a third SUN where the last SUN won't fall on EOM

    ------------------ CA-7 CPU JOB SCHEDULING PARAMETER EDIT ------------------
    FUNCTION: LIST (ADD,DELETE,EXIT,FORMAT,LIST,REPL,SAVE,SR,SS)
    JOB: TESTLEO6 SCHID: 198 SCAL: ROLL: N INDEX: 000
    DOTM LDTM SBTM ---------------------REPEAT----------------------
    0805 0001 0800 INTERVAL: 0000 TYPE: COUNT: 0000 STOP: 0000



    __ __ DAILY
    __ __ WEEKLY SUN: MON: TUE: WED: THU: FRI: SAT:

    __ X __ MONTHLY JAN: FEB: X MAR: APR: MAY: JUN:
    JUL: AUG: SEP: OCT: NOV: DEC:
    WEEK: -0,-1 DAY-OF-WEEK: SUN
    RDAY: /15,/16,/17,/18,/19,/20,/28,/29

    __ __ ANNUAL DAY:
    DEFAULT SCAL: 7H
    __ __ SYMETRIC START: SPAN: SCHID-COUNT: 003



    ------------------ CA-7 CPU JOB SCHEDULING PARAMETER EDIT ------------------
    FUNCTION: LIST (ADD,DELETE,EXIT,FORMAT,LIST,REPL,SAVE,SR,SS)
    JOB: TESTLEO6 SCHID: 199 SCAL: ROLL: N INDEX: 000
    DOTM LDTM SBTM ---------------------REPEAT----------------------
    0805 0001 0800 INTERVAL: 0000 TYPE: COUNT: 0000 STOP: 0000



    __ __ DAILY
    __ __ WEEKLY SUN: MON: TUE: WED: THU: FRI: SAT:

    __ X __ MONTHLY JAN: X FEB: MAR: X APR: MAY: X JUN:
    JUL: X AUG: X SEP: OCT: X NOV: DEC: X
    WEEK: -0,-1 DAY-OF-WEEK: SUN
    RDAY: /18,/19,/20,/21,/22,/23,/31

    __ __ ANNUAL DAY:
    DEFAULT SCAL: 7H
    __ __ SYMETRIC START: SPAN: SCHID-COUNT: 003


    ------------------ CA-7 CPU JOB SCHEDULING PARAMETER EDIT ------------------
    FUNCTION: LIST (ADD,DELETE,EXIT,FORMAT,LIST,REPL,SAVE,SR,SS)
    JOB: TESTLEO6 SCHID: 200 SCAL: ROLL: N INDEX: 000
    DOTM LDTM SBTM ---------------------REPEAT----------------------
    0805 0001 0800 INTERVAL: 0000 TYPE: COUNT: 0000 STOP: 0000



    __ __ DAILY
    __ __ WEEKLY SUN: MON: TUE: WED: THU: FRI: SAT:

    __ X __ MONTHLY JAN: FEB: MAR: APR: X MAY: JUN: X
    JUL: AUG: SEP: X OCT: NOV: X DEC:
    WEEK: -0,-1 DAY-OF-WEEK: SUN
    RDAY: /17,/18,/19,/20,/21,/22,/30

    __ __ ANNUAL DAY:
    DEFAULT SCAL: 7H
    __ __ SYMETRIC START: SPAN: SCHID-COUNT: 003
     ​

    ------------------------------
    Production Support Analyst
    IBM
    ------------------------------