Applying the Sliding Window Technique
To apply the sliding window technique correctly, you
need to understand the difference between a date format (formerly
called a smart date) and a legacy date:
- A date
format refers to an internally stored integer that represents the
number of days between a real date value and a base date (either
December 31, 1900, for dates with YMD or YYMD format; or January
1901, for dates with YM, YYM, YQ, or YYQ format). A Master File
does not specify a data type or length for a date format; instead, it
specifies display options such as D (day), M (month), Y (2-digit
year), or YY (4-digit year). For example, MDYY in the USAGE (also
known as FORMAT) attribute of a Master File is a date format. A
real date value such as March 5, 1999, displays as 03/05/1999, and
is internally stored as the offset from December 31, 1900.
- A legacy date
refers to an integer, packed decimal, double precision, floating
point, or alphanumeric format with date edit options, such as I6YMD,
A6MDY, I8YYMD, or A8MDYY. For example, A6MDY is a 6-byte alphanumeric
string; the suffix MDY indicates how Information Builders will return
the data in the field. The sample value 030599 displays as 03/05/99.
For details on date fields, see the Describing Data manual.
xWhen to Supply Settings for DEFCENT and YRTHRESH
The rest of this topic refers simply to DEFCENT when
either DEFCENT or FDEFCENT applies, and to YRTHRESH when either
YRTHRESH or FYRTHRESH applies.
Supply settings for DEFCENT and YRTHRESH in the following cases:
- When you
issue a DEFINE or COMPUTE command to convert a legacy date without
century digits to a date format with century digits (for example,
to convert the format I6YMD to YYMD). With DEFINE and COMPUTE, DEFCENT
and YRTHRESH do not work directly on legacy dates; for example,
you cannot use them to convert the legacy date format I6YMD to the
legacy date format I8YYMD.
- When a DEFINE
command, COMPUTE command, or Dialogue Manager -SET command calls
a function, supplied by Information Builders, that uses legacy dates,
the input date does not contain century digits.
On input, the
function will use the window defined for an 16 legacy date field
(with edit options). The output format may be 18 (again, with edit
options), which includes a 4-digit year.
- When a
data source is read, and the ACTUAL attribute in the Master File
is non-date specific (for example, A6, I6, or P6), without century
digits, and the FORMAT or USAGE attribute specifies a date format.
This case does not apply to FOCUS data sources.
Follow these rules when implementing the sliding window technique:
- Specify
values for both DEFCENT and YRTHRESH to ensure consistent coding and
accurate results, except when YRTHRESH has a negative value. In
that case, specify a value for YRTHRESH only; do not code a value
for DEFCENT.
- Do not use
DEFCENT and YRTHRESH with ON TABLE SET.
Finally, keep in mind that the sliding window technique does
not change the way existing data is stored. Rather, it accurately
interprets data during application processing.
x
Reference: Restrictions With MODIFY
The
following results occur when you use the sliding window technique
with a MODIFY request or FOCCOMP procedure:
- A MODIFY request
compiled prior to Version 7.0 Release 6, when run with global SET
DEFCENT and SET YRTHRESH settings, or with file-level or field-level
settings, yields a FOC1886 error message. You must recompile the
MODIFY request.
- A MODIFY request
compiled in Version 7.0 Release 6, when run with global SET DEFCENT
and SET YRTHRESH settings, or with file-level or field-level settings,
yields a FOC1885 warning message.
- A FOCCOMP
procedure, compiled with global SET DEFCENT and SET YRTHRESH settings,
and run in releases prior to Version 7.0 Release 6, yields a FOC548
invalid version message. You must recompile the MODIFY request.
- A FOCCOMP
procedure that contains DEFCENT/YRTHRESH or FDEFCENT/FYRTHRESH attributes
in the associated Master File, and run in releases prior to Version
7.0 Release 6, yields a FOC306 description error message.
x
Date formats are validated on input. For example, 11/99/1999
is rejected as input to a date field formatted as MDYY, because
99 is not a valid day. Information Builders generates an error message.
Legacy dates are not validated. The date 11991999, described
with the format A8MDYY, is accepted, even though it, too, contains
the invalid day 99.