:SET_CALE

Script Statement: Inserts/deletes a date or time period in/from a Calendar Event.

Syntax

:SET_CALE Calendar, Calendar Event, [Date Format:]Date1[,[Date Format:]Date2[,Action]]

Syntax

Description/Format

Calendar

Name of the Calendar object in/from which a date/time period should be added or removed.
Format: AE name, script literal or script variable

Calendar Event

Name of the Calendar Event in/from which a date/time period should be added or removed.
Format: AE name, script literal or script variable

Date1
and

Date2

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.

Action

Marker for adding or removing.
Format: AE name, script literal or script variable

Allowed values: "ON" (default value), "OFF"
"ON" - Add date/time period
"OFF" - Remove date/time period

You can use this script statement to add or remove a date/time period from a Calendar object.

If only one date should be added or removed, it is not necessary to specify Date2. For a time period, both Date1 and Date2 must be specified.

Optionally, you can specify a particular date format. The default date formats that should be used are "YYMMDD" or "YYYYMMDD".

If the assumed Calendar Event does not exist, the script statement creates a new, non-recurring Calendar Event. By default, the current year minus NOW_MINUS and plus NOW_PLUS is used. Both specifications are keys that the administrator specified in the AE variable UC_CLIENT_SETTINGS. You can modify the validity range by using a script subsequently. For more information, see MODIFY_OBJECT.

When adding dates or times, this script statement ignores existing date/time period specifications. The same is true if you remove a date/time period that does not exist.

Tip: You can write a script to check whether a date is valid given a particular Calendar object and Calendar Event. For more information, see VALID_CALE.

Note: No calendar calculation is triggered while this script statement is being processed. Open and store the Calendar object manually to have the calendar recalculated.

Examples

The first example adds a date to the calendar "Readiness" and the Calendar Event "BU".

:SET_CALE "READINESS", "BU", "YY-MM-DD:00-12-24"

The second example removes the current day from this calendar.

:SET &TODAY# = SYS_DATE()
:
SET_CALE "READINESS", "BU", &TODAY#,, OFF

The third example determines the beginning and end of the current week. Afterward, the time period is entered in the calendar.

:SET &TODAY# = SYS_DATE()
:
SET &BEGINNING# = FIRST_OF_PERIOD (&TODAY#, "WW")
:
SET &END# = LAST_OF_PERIOD (&TODAY#, "WW")
:
SET_CALE "READINESS", "BU", &BEGINNING#, &END#

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts

Calendars (CALE)