Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Purpose

The purpose of this wiki is to decode the schedule pattern embedded in AL_SCHED_INFO table in the local repository and identify the run days, date and time by looking at AL_SCHED_INFO table.

Overview

When you add schedule for a job from Data Services Management Console, you can specify recurring or non recurring schedule and days of week or days of month it should occur. The schedule once created adds a row in AL_SCHED_INFO repository table, in which the job exists. AL_SCHED_INFO table contains 2 columns: RECURRENCE_PATTERN and RECURRENCE_TYPE which has information about type scheduling pattern for the particular schedule. However RECURRENCE_PATTERN field is encoded and it is tough to identify the recurrence pattern of the schedule by just looking at it. The following sections describe how to decode RECURRENCE_PATTERN to identify the recurring pattern for the schedule.

Non recurring schedules

Non recurring schedules can be easily decoded by just looking at RECURRENCE_PATTERN. Here is a table of what's the value of RECURRENCE_PATTERN and RECURRENCE_TYPE and what's the corresponding schedule. For non recurring schedules RECURRENCE_PATTERN is always a positive number ranging from 1 to 31.

RECURRENCE_TYPE

RECURRENCE_PATTERN

Schedule Day

WEEKLY

1

Monday

WEEKLY

2

Tuesday

WEEKLY

3

Wednesday

WEEKLY

4

Thursday

WEEKLY

5

Friday

WEEKLY

6

Saturday

WEEKLY

7

Sunday

MONTHLY

1..31

1..31th day of the month

When the schedule is non recurring value of RECURRENCE_PATTERN is always a positive number that goes from 1 to 31. If RECURRENCE_TYPE is WEEKLY the number goes from 1 to 7 each representing a day of week going from Monday to Sunday. If RECURRENCE_TYPE is MONTHLY the number goes from 1 to 31 each representing one specific day of the month.

Recurring schedules

Recurring schedules are much complicated as there are multiple combinations in which a recurrence can occur. In case of recurring schedules RECURRENCE_PATTERN is always a negative number of order of 2^31. E.g. -2147483634 and the possible range is -1 to -2147483647 and we can use a simple formula as follows to demystify that number:

if ( RECURRENCE_PATTERN < 0) Use 2^31 + RECURRENCE_PATTERN where 2^31 is 31st power of 2.

  • For Recurring Schedules using Days of Week :
    With 7 days of week there will be a total of 2^7 - 1 = 127 combination. Here is an example of some of them. You can similarly identify rest of the scheduling patterns. They can be understood better if represented as binary, with Monday at unit's place, Tuesday at 2's place and so on. 1 in binary number means schedule occurs for that day 0 means no schedule on that day.

    RECURRENCE_TYPE

    2^31 + RECURRENCE_PATTERN

    In Binary

    Schedule days

    WEEKLY

    1

    1

    Monday

    WEEKLY

    2

    10

    Tuesday

    WEEKLY

    3

    11

    Tuesday,Monday

    WEEKLY

    4

    100

    Wednesday

    WEEKLY

    5

    101

    Wednesday, Monday

    WEEKLY

    6

    110

    Wednesday,Tuesday

    WEEKLY

    7

    110

    Wednesday,Tuesday,Monday

    WEEKLY

    8

    1000

    Thursday

    WEEKLY

    40

    110000

    Saturday, Friday

    WEEKLY

    100

    1100100

    Sunday, Saturday, Wednesday

    WEEKLY

    121

    1111001

    Sunday, Saturday, Friday, Thursday, Monday

    WEEKLY

    127

    1111111

    Sunday, Saturday, Friday, Thursday, Wednesday,Tuesday,Monday

  • For Recurring Schedules using Days of Month :
    The logic for computing recurring schedule SCHEDULE_PATTERN values for when schedules use days of month is similar. With up to 31 days of month there will be a total of 2^31 - 1 = 2147483647 different combinations. Here is an example of some of them. You can similarly identify rest of the scheduling patterns. They can be understood better if represented as binary, with 1st day of month at unit's place 2nd day of month at 2's place and so on. 1 in binary number means schedule occurs for that day 0 means no schedule on that day.

    RECURRENCE_TYPE

    2^31 + RECURRENCE_PATTERN

    In Binary

    Schedule days

    MONTHLY

    1

    1

    1st Day of Month

    MONTHLY

    5

    101

    3rd, 1st day of month

    MONTHLY

    8

    1000

    4th day of month

    MONTHLY

    12

    1100

    4th, 3rd day of month

    MONTHLY

    18

    10010

    5th, 2nd day of month

    MONTHLY

    20

    10100

    5th, 3rd day of month

    MONTHLY

    100

    1100100

    7th, 6th, 3rd day of month

    MONTHLY

    500

    111110100

    9th, 8th, 7th, 6th, 5th, 3rd day of month

    MONTHLY

    1000

    1111101000

    10th, 9th, 8th, 7th, 6th, 4th day of month

    MONTHLY

    64

    1000000

    7th day of month

    MONTHLY

    200

    11001000

    8th, 7th, 4th day of month

    MONTHLY

    2147483647

    1111111111111111111111111111111

    All 31 days of the month

    Schedule Once a Day

    If the Job is scheduled once a day normally the values for HOUR_BEGIN, HOUR_END, INTERVAL columns in AL_SCHED_INFO are 0. To find the actual run time use column START_TIME in AL_SCHED_INFO table. Ignore the date portion of START_TIME while the time portion of START_TIME gives the time at which the job is scheduled to run.

    Schedule Multiple times a Day

    If the job is scheduled multiple times a day The START_TIME column of AL_SCHED_INFO contains the date and time when the schedule was created. HOUR_END column contains the duration in minute for which the job will continue to execute and INTERVAL column contains the schedule interval. Interval in minutes is the time the engine would wait till it launches the next job execution after the current execution.
    To get the actual start time look at the value for column HOUR_BEGIN. It contains minutes after 12:00 AM (midnight) on the scheduled day.
    E.g. If the job is scheduled at 10:00 AM in the morning and will continue to run at 10 minute interval for 100 minutes. The corresponding values in AL_SCHED_INFO table would be as follows:
    HOUR_BEGIN = 600 ( 60 * 10 Hours after midnight) INTERVAL = 10 and HOUR_END = 100

    Related Content

Related Documents

Related Notes

  • No labels