Class Reference
Cache for UNIX 2018.1.1
InterSystems: The power behind what matters   
Documentation  Search
Private  Storage  

class %SYS.Date.SlidingWindow extends %RegisteredObject

The %SYS.Date.SlidingWindow class supports methods for setting, modifying and inspecting the system-wide or process-specific sliding window definitions. With the exception of Get(), all the other class methods return a %Status to indicate success or failure. Any modified system-wide definition will be active until the system is restarted. If necessary, users can add the new settings to ^ZSTU or ^%ZSTART in order to make them survive across reboots.

In most cases, the first parameter indicates whether the call is system or process-specific:

Scope = 0: system (default)
Scope = 1: process

Depending of the method, start and end dates can be specified in 3 different ways:

  1. Absolute Dates, represented in $H format
  2. Absolute Years, represented by 4-digit numbers relative to the start of the Common Era (0 C.E.)
  3. Relative Years, represented by numbers relative the current year
When relative years are used to define a sliding window, the first or only relative year is interpreted as the start year, expressed as the number of years PRIOR to the current year. The second relative year, if any, is interpreted as the end year, expressed as one more than the number of years AFTER the current year.


Parameters Properties Methods Queries Indices ForeignKeys Triggers


%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
Get NoWindow SetAbsolute SetDate
SetRelative Twentieth UseDefault


• classmethod Get(Scope As %Integer = 0) as %String
Get current default definition in the format:


Where OldStartDate and OldEndDate are absolute dates in $H format representing the start and end, respectively, of the current sliding window.
• classmethod NoWindow(Scope As %Integer = 0) as %String
Set default to be an "empty" window, so that all years display using 4 digits.
• classmethod SetAbsolute(Scope As %Integer = 0, StartYear As %Integer, EndYear As %Integer) as %Status
Set date window to begin on the absolute year StarYear and to end on the absolute year EndYear.
• classmethod SetDate(Scope As %Integer = 0, StartDate As %Integer, EndDate As %Integer) as %Status
Set date window to begin on the absolute date StartDate and to end on the absolute date EndDate.
• classmethod SetRelative(Scope As %Integer = 0, StartYear As %Integer, EndYear As %Integer) as %Status
Set date window to begin on the relative year StartYear and to end on the relative year EndYear.

Example: If issued in 2008, the following command would establish a process-specific sliding window definition which would result in this process displaying two-digit years for any dates in the range 01/01/1918 through 12/31/2017, inclusive.

Set status=##class(%SYS.Date.SlidingWindow).SetRelative(1,90,10)
• classmethod Twentieth(Scope As %Integer = 0) as %Status
Remove current default so that a 20th century fixed window is used by default.
• classmethod UseDefault()
Set process window to be the same as the current system default.

Copyright © 1997-2019, InterSystems Corporation