Specifying Dates Using Natural Language

As a scheduling application, JAMS uses date specifications for many of its features and functions. Sometimes using exact date specification is sufficient for scheduling a Job. However, a generic date, such as using Workdays or First Friday of the Month, can provide additional flexibility. JAMS supports natural language and generic date entries throughout the client interface.

There are two key scenarios for JAMS to accept generic date specifications:

  • Scheduled dates: Generic dates can be used when scheduling a Job in JAMS.
  • Default parameters: If a Job parameter’s data type is DATE, you can specify a default value using generic date specifications.
NOTE: When you select a Job, you will see a form to set values for the Job's parameters. Parameters with a data type of DATE are presented using the standard MM/DD/YY date field, but JAMS uses the generic date specification to determine the default date.
NOTE: When JAMS automatically submits Jobs, prompting for the parameter values is not possible. Instead, the generic date specification is evaluated to obtain the value for the parameter.

Simple Date Specifications

Simple date specifications specify a date relative to the current date. The format and description for a simple date specification is as follows:

  • Day-of-Week: This can be the full name of a weekday or the first three letters of a weekday name. When specifying a day of the week, such as MONDAY, JAMS interprets this as “Monday of this week.” In this context, a week begins on Monday and ends on Sunday.
    • The days of the week can be preceded by a modifier such as LAST, THIS, or NEXT. Inserting a THIS modifier has no effect and is used only for readability.
    • When using a modifier, such as LAST, JAMS interprets this to mean " the weekday from last week." If you specify “Last Holidays”, the Job cannot be scheduled because JAMS evaluates this as a date in the past. 
  • Workdays: If you specify "WORKDAY" or "WORKDAYS", JAMS determines if a day is a workday using a two-step process.
    1. JAMS looks at the WORK_ddd configuration setting, where ddd indicates the day of the week, such as Wednesday. This sets up the initial true or false indication that the day is indeed a workday.
    2. For the date in question, JAMS also searches for special dates. To access special dates, select the Calendar shortcut and double-click the desired date within a DateType in the Calendar.
      • If the Workday check box is enabled, the date is a workday.
      • If the Workday box is unchecked, the date is not a workday.
      • However, if the check box is filled, it indicates that the special date should have no effect on the workday status.
  • Weekdays: This specifies the first weekday after the current date.
  • Today: This identifies the current date.
  • Tomorrow: This displays the current date plus one day.
  • Yesterday: This displays the current date minus one day.
  • Daily: This is synonymous with TODAY and used primarily for readability.
  • +/- number of days: This is a simple date specification that can have positive or negative integers appended to add or subtract the indicated number of days.
    • Weekdays-1 or Workdays-1: This specification schedules Jobs to run on Sundays rather than all days before weekdays/workdays (Sunday-Thursday). When JAMS evaluates the specification on a weekday, the resulting day will always be in the past and the Jobs are not scheduled. When the specification is evaluated on a Tuesday, the result is Monday because Tuesday is the next weekday. On a Sunday, the next weekday is Monday so it evaluates to Sunday. As an alternative, set the Scheduled Date property to Daily and the Except For Date property to specific days such as Friday or Saturday.
    • Weekdays+1 or Workdays+1: This specification is accepted, but no entries are scheduled. When JAMS evaluates the specification, the scheduled date will always be evaluated in the future. When evaluated on a Tuesday, the result is Wednesday. As an alternative, set the Scheduled Date property to Weekdays, Saturday and the Except For Date property to Monday.

  • Every Other (day): JAMS will use the next available occurrence of the specified date type, repeating on each alternate available date. Days can be set using Day-of-Week specifications, Weekday, or Workday.
    •  To determine the next scheduled date for Job, the Scheduled Date and the Last Autosubmit Dates for the Job are used. You can view the Scheduled Date from the Schedule tab in the Job Definition and the Last Autosubmit Date from the Definitions screen, if you add the column from the Column Chooser. (Right-click any column heading and select Column Chooser.) If the Last Autosubmit Date is after the Scheduled Date, the Autosubmit Date is used to calculate the next execution of the Job. If neither date has a value, the current date is used as the start date.The Last Autosubmit Date is used rather than the "Scheduled Start Date", so you can have Jobs that are constantly shifting.
    • Example A:
      You could have a Job scheduled for "First Monday of Month, Every other Monday" and it would run on the following Dates: 
      • January 2, 2023
      • January 16, 2023
      • January 30, 2023
      • February 6, 2023 (There is only a one-week gap due to the "First Monday of Month" option.)
      • February 20, 2023 (This is from the "Every other Monday" option, but it shifted due to the previous short gap.)
    • Example B:
      • Job A is created on Saturday and scheduled to run "Every Other Workday". The Job will run on Monday, Wednesday, and Friday the first week, and then Tuesday and Thursday the second week, and so on.

Valid Simple Date Specifications

Included below are some examples of valid, simple-date specifications:

  • TODAY + 5
  • NEXT MONDAY
  • LAST TUESDAY
  • WORKDAYS
  • Every Other Friday

Complex Date Specifications

Complex date specifications are used to stipulate a date relative to an arbitrary period of time, such as describing a month or fiscal period.

 A complex date specification may be thought of as two components: the day specification and the period specification. For example, in the text "1st WORKDAY of NEXT MONTH," the day specification is 1st WORKDAY and the period specification is NEXT MONTH.

The general format of a complex date specification is as follows: [day-of-period OF] period [+/- number of days]. The syntax for the day-of-period specification can take one of two forms. Both forms are comparable. The two forms for the day-of-period specification are:

Form 1

FIRST

LAST

1[st]

2[nd]

3[rd]

integer [st, nd, th]

  • Day-of-week
  • WORKDAY
  • WEEKDAY
  • DAY
  • MONTH

Or . . .

Form 2

Day-of-week

WORKDAY

WEEKDAY

WEEK

DAY

MONTH

OF

  • FIRST
  • LAST
  • 1[st]
  • 2[nd]
  • 3[rd]
  • integer [st, nd, th]
NOTE: If you do not specify the day of period, the default becomes the current day.

The syntax for the period specification is:

THIS

NEXT

LAST

  • YEAR
  • MONTH
  • Month-name
  • Date-Type
  • Specific-Date-Type
  • Date-Type Specific-Date-Type
NOTE: While this syntax specification may seem overly complex, it mimics how people commonly specify dates.

User Defined Period

When specifying a period with user defined Date Types, you may need to supply both specific and generic Date Types. For example, if you defined the Date Type FISCAL with specific Date Types of PERIOD_01 through PERIOD_12, you can specify the second period as: FISCAL PERIOD_02 or PERIOD_02.

If you defined two Date Types that both use the specific Date Type PERIOD_02, then you must specify FISCAL PERIOD_02.

Specifying Weeks

When used in the context of a time period, a week is defined as starting on the first day of the period and continuing for seven days.

Valid Complex-Date Specifications The following examples of valid complex-date specifications are based on the current date being January 1st, 2014.

Specification Date
FIRST MONDAY OF NEXT MONTH 03-FEB-2014
2ND MONDAY OF THIS MONTH 13-JAN-2014
FIRST MONDAY OF LAST JANUARY 07-JAN-2013
6TH WEEKDAY OF NEXT MONTH 10-FEB-2014
6TH WEEKDAY OF MONTH 08-JAN-2014
LAST DAY OF LAST MONTH 31-DEC-2013
2nd DAY OF THIS WEEK 31-DEC-2013
3RD DAY OF WEEK 3RD DAY OF EACH WEEK

Related Topics