CALE_LOOK_AHEAD

Script Function: Returns the next date based on calendar conditions.

Syntax

CALE_LOOK_AHEAD ([[Date Format]:Date], JOBP|JSCH, Task Number)
CALE_LOOK_AHEAD ([[Date Format]:Date], Condition, Calendar, Calendar Event [ [,Calendar][,Calendar Event] ]...)

Syntax

Description/Format

Date

Date in YYMMDD or YYYYMMDD format

Format: script literal or script variable

(Optional) You can specify a different date format: enter the desired date format, a separator (: or ;) and the date.

JOBP|JSCH

Name of a workflow or schedule
Format: script literal or script variable

Task Number

Task number in the workflow or the schedule
Format: script literal or script variable

Condition

Condition that must apply for the definition of date
Format: script literal or script variable

Allowed values: "ONE", "ALL", "NO"

"ONE" - One of the given calendar conditions must apply
"ALL" - All the given calendar conditions must apply
"NO" - None of the given calendar conditions must apply

Note: If no calendar condition applies for a task, a SPACE is returned. In this case, CALE_LOOK_AHEAD_MAX is displayed in the Schedule Monitor (see Monitoring Schedules).

Calendar

Name of a Calendar object
Format: script literal or script variable

Calendar Event

Calendar Event in this Calendar object
Format: script literal or script variable


Return codes

Date in the specified format
" " - No calendar condition applies

The script function may be used in two different ways.

On the one hand, it is possible to determine a respective object's next date of execution according to given calendar conditions. The object can be identified by its task number, which is displayed in the graphical picture of the workflow in the order in which the objects were added to the workflow. The schedule shows the objects, which are numbered according to their order in the list of the Schedule tab.

On the other hand, the script function supports the calculation of the next date on which one, all, or no calendar conditions apply. Up to five Calendars may be specified, including Calendar Events. The maximum number of days that are to be considered when checking for the next valid date may be specified for each client by the administrator in the variable UC_CLIENT_SETTINGS with the key "CALE_LOOK_AHEAD_MAX".

It is possible to specify the date from which on calendar conditions should be checked. Optionally, you may specify a particular Date Format. The default Date Formats to be used are "YYMMDD" or "YYYYMMDD". A colon or semicolon may be used as a separator between Date Format and Date. If no date is specified, the particular current date is used for calculation.

Note: This script function supplies the date either in the default format or in the format that has been defined in its first parameter.

Warning! Please note that the parameters Calendar and Calendar Eventmust always be used together (see example below).

Examples

The following example shows how to identify the next date on which the object with task number "3" will run in the workflow "MM.DAY".

:SET  &DATE# = CALE_LOOK_AHEAD('YYYYMMDD:20041010','MM.DAY','3')

The second example identifies the next date on which all assigned calendar conditions apply.

:SET  &DATE# = CALE_LOOK_AHEAD(,'ALL','FIRM.CALENDAR','WORKDAYS','FIRM.CALENDAR','READINESS01')

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts

Calendars (CALE)