Fast/Unload DATESTAT analysis: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
m (more conversion cleanup)
Line 1: Line 1:
<!-- Page name: Fast/Unload DATESTAT analysis-->
<!-- Page name: Fast/Unload DATESTAT analysis-->
<p></p>
If the <var>[[Fast/Unload Extraction_Language (FUEL)#DATESTAT [SUMMARY | DETAIL]|DATESTAT]]</var> statement is present in the <code>FUNIN</code> data set,
If the DATESTAT statement is present in the FUNIN dataset,
<var class="product">Fast/Unload</var> will determine which fields in the file contain date
<var class="product">Fast/Unload</var> will determine which fields in the file contain date
values.
values.
The determination of whether a field contains a date value is done
The determination of whether a field contains a date value is done in two passes:
in two passes; the first pass
<ul>
examines 1000 evenly-distributed records in the file, and the second
<li>The first pass examines 1000 evenly-distributed records in the file.</li>
pass analyzes all records.
 
<li>The second pass analyzes all records.</li>
</ul>
 
At the end of each pass, certain fields are retained for date
At the end of each pass, certain fields are retained for date
analysis and reporting.
analysis and reporting. A field is retained if:
A field is retained if:
<ol>
<ol>
<li>for pass one, the field is not found in the 1000 records
<li>For pass one, the field is not found in the 1000 records. </li>
<li>at least one value of the field is found in the pass which
 
conforms to a date format, except:
<li>At least one field value that conforms to a date format is found in the pass, except:
<table>
<p class="note">A field is not a date if all dates were all numeric, there were more than 5 distinct non-date values, and fewer than 50% of the instances are dates. This is an attempt to avoid situations in which a field such as zip code could be treated as a 5-digit (YYDDD) date.</p></li>
<tr><th>*</th><td>a field is not a date if all dates were all numeric, there were more than 5 distinct non-date values, and less than 50% of the instances are dates. This is to attempt to avoid situations in which a field such as zip code could be treated as a 5 digit (YYDDD) date.</td></tr>
</table>
</ol>
</ol>
<p></p>
<p>
Note that Blob fields are not candidates for DATESTAT analysis.
Note that Blob fields are not candidates for <var>DATESTAT</var> analysis.</p>
<p></p>
<p>
The analysis keeps tracks of various totals that are used in
The analysis keeps tracks of various totals that are used in
reporting, and also keeps some of the values found in the field.
reporting, and also keeps some of the values found in the field.
Up to 36 date formats, 20 nondate values, and 120 year samples
Up to 36 date formats, 20 non-date values, and 120 year-samples
will be kept.
will be kept.
When these overflow, the least-recently-found year and nondate
If these overflow, the least-recently-found year and non-date
samples are discarded, and the most-recently-found date format
samples are discarded, and the most-recently-found date format
sample is discarded.
sample is discarded.
Also, only up to 22 characters of nondate values are kept, so
<p class="note"><b>Note:</b> Since only as many as 22 characters of non-date values are kept,  
two different values which are the same in the first 22 characters
two different values that are the same in the first 22 characters
will be considered to be the same value.
are considered to be the same value.</p>
<p></p>
<p>
The date formats searched for consist of the following list,
The date formats that are searched for consist of the following list,
plus each one of the formats in this list, followed by a blank and
plus each one of the formats in this list, followed by a blank and
time in the form HH:MI:SS, if the date format contains a
time in the form HH:MI:SS, if the date format contains a
character other than M, D, or Y, or followed immediately by
character other than M, D, or Y, or followed immediately by
time in the form HHMMSS otherwise.
time in the form HHMMSS otherwise.</p>
<p class="code"><nowiki>MON DAY YY
<p class="code">MON DAY YY
MON DAY YYYY
MON DAY YYYY
DAY MON YY
DAY MON YY
Line 68: Line 67:
YYYYMMDD
YYYYMMDD
YYYYIMMIDD
YYYYIMMIDD
</nowiki></p>
</p>
For the meaning of the components of these formats, see
For the meaning of the components of these formats, see
[[Fast/Unload datetime processing considerations#dtfmt|Datetime formats]].
[[Fast/Unload datetime processing considerations#dtfmt|Datetime formats]].
Line 76: Line 75:
<!--Caution: <div> above-->
<!--Caution: <div> above-->
   
   
<p></p>
This section describes the reports created by the <var>DATESTAT SUMMARY</var>
This section describes the reports created by the DATESTAT SUMMARY
and <var>DATESTAT DETAIL</var> statements.
and DATESTAT DETAIL statements.
Both of these statements indicate something about the "quality" of the
Both of these statements indicate something about the "quality" of the
date data in the field.
date data in the field.
The purposes of "date field quality" are:
The purposes of "date field quality" are:
<ol>
<ul>
<li>If you are running DATESTAT SUMMARY, and you have some values other
<li>If you are running <var>DATESTAT SUMMARY</var>, and you have some values other
than <b>pure</b>, you may want to do further investigation of the
than <b>pure</b>, you may want to do further investigation of the
date fields.
date fields.</li>
 
<li>To indicate how much work might be involved to resolve the various
<li>To indicate how much work might be involved to resolve the various
values stored in the field.
values stored in the field.
One tool to resolve the values is to run DATESTAT DETAIL; doing some
One tool to resolve the values is to run <var>DATESTAT DETAIL</var>. Doing some
ad-hoc work with User Language is another approach.
ad-hoc work with [[SOUL]] is another approach.
The "worse" the quality of a field, the more work is likely to be
The "worse" the quality of a field, the more work is likely to be
required to resolve questions about the field values.
required to resolve questions about the field values.</li>
</ol>
</ul>
<p></p>
 
The quality is expressed as <b>pure</b>,
The quality is expressed as <b>pure</b>,
<b>good</b>, <b>fair</b>, or <b>poor</b>;  it is
<b>good</b>, <b>fair</b>, or <b>poor</b>. It is
an attempt to measure the possible level of effort required to correct
an attempt to measure the possible level of effort required to correct
data on the file.
data on the file.
The terms have the following meanings:
The terms have the following meanings:
<table>
<table class="thJustBold">
<tr><th>Pure</th><td>means that there are only date values, and all with a single date format.</td></tr>
<tr><th>Pure</th>
<tr><th>Poor</th><td>means either there are more than 10 distinct non-date values and more than .01% of the field occurrences are non-date values, or the percent of date values which have uncommon formats, times the number of uncommon formats, is greater than .01%, or there are more than 20 date formats. <p></p> If there are more than 20 date formats, or if the ratio of occurrences of the most common date format to occurrences of the next most common date format is less than 10 to 1, then <var class="product">Fast/Unload</var> prints the string "Common date format not found".</td></tr>
<td>There are only date values, and all with a single date format.</td></tr>
<tr><th>Fair</th><td>means either there are more than 5 distinct non-date values and more than .001% of the field occurrences are non-date values, or the percent of date values which have uncommon formats, times the number of uncommon formats, is greater than .001%.</td></tr>
 
<tr><th>Good</th><td>is anything else.</td></tr>
<tr><th>Poor</th>
<td>Either of these:
<ul>
<li>There are more than 10 distinct non-date values and more than .01% of the field occurrences are non-date values.</li>
 
<li>The percentage of date values that have uncommon formats, times the number of uncommon formats, is greater than .01%, or there are more than 20 date formats. </li>
</ul>
<p>
If there are more than 20 date formats, or if the ratio of occurrences of the most common date format to occurrences of the next most common date format is less than 10 to 1, then <var class="product">Fast/Unload</var> prints the string "Common date format not found".</p></td></tr>
 
<tr><th>Fair</th>
<td>Either of these:
<ul>
<li>There are more than 5 distinct non-date values and more than .001% of the field occurrences are non-date values.</li>
 
<li>The percentage of date values that have uncommon formats, times the number of uncommon formats, is greater than .001%.</li>
</ul></td></tr>
 
<tr><th>Good</th>
<td>Anything else.</td></tr>
</table>
</table>
==DATESTAT SUMMARY==
==DATESTAT SUMMARY==
DATESTAT SUMMARY creates a report with 1-3 lines for each date field, in
<var>DATESTAT SUMMARY</var> creates a report with 1-3 lines for each date field, in
the following form:
the following form:
<ol>
<ol>
<li><i>ftag format</i> (<i>qual</i>)  <i>span</i>
<li><i>ftag format</i> (<i>qual</i>)  <i>span</i>
field...<i>n</i>: <i>name</i>
field...<i>n</i>: <i>name</i> </li>
<li><i>tot</i> occurrences of field  <i>format count</i>
 
<li><i>tot</i> occurrences of field  <i>format count</i> </li>
 
<li><i>nsmp</i> occurrences of nondate value (len <i>len</i>):
<li><i>nsmp</i> occurrences of nondate value (len <i>len</i>):
<i>sample</i>
<i>sample</i> </li>
</ol>
</ol>
<p></p>
<p>
Where:
Where:
<ol>
<ol>
Line 122: Line 143:
<li><i>ftag</i>
<li><i>ftag</i>
is either "Common date format not found", if there are more than
is either "Common date format not found", if there are more than
20 date formats, or "Common format:" otherwise.
20 date formats, or "Common format:" otherwise. </li>
 
<li><i>format</i> is the most commonly occurring date format,
<li><i>format</i> is the most commonly occurring date format,
if <i>ftag</i> is "Common format:", or blank otherwise.
if <i>ftag</i> is "Common format:", or blank otherwise. </li>
<li><i>qual</i> is either "pure", "good", "fair", or "poor".
 
<li><i>qual</i> is either "pure", "good", "fair", or "poor". </li>
 
<li><i>span</i> is either:
<li><i>span</i> is either:
<br/>    <b>CENTSPAN:</b> <i>YYYY</i>
<b>CENTSPAN:</b> <i>YYYY</i>
<br/>or <b>No YY occurrences</b>
<br/>or <b>No YY occurrences</b>
<br/>The former gives a recommended CENTSPAN,
<br/>The former gives a recommended CENTSPAN,
Line 135: Line 159:
(2-digit years are interpreted using
(2-digit years are interpreted using
a CENTSPAN of 1900, or, if running DATESTAT after 1999, a
a CENTSPAN of 1900, or, if running DATESTAT after 1999, a
CENTSPAN of -99.)
CENTSPAN of -99.) </li>
 
<li><i>n</i>
<li><i>n</i>
is a sequential numbering of the fields; this can be correlated to
is a sequential numbering of the fields; this can be correlated to
an FSTATS report.
an FSTATS report. </li>
<li><i>name</i> is the name of the field.
 
</ul>
<li><i>name</i> is the name of the field. </li>
<li>This line is always printed if the <i>qual</i>
</ul> </li>
is not <b>pure</b>.
 
<li>This line is always printed if the <i>qual</i> is not <b>pure</b>.
The components are:
The components are:
<ul>
<ul>
<li><i>tot</i>
<li><i>tot</i> is the total number of occurrences of the field in the file </li>
is the total number of occurrences of the field in the file
 
<li><i>format count</i>
<li><i>format count</i> is either <i>n</i> <b>different formats found</b>, if
is either <i>n</i> <b>different formats found</b>, if
<i>n</i> is more than 1, or blank otherwise. </li>
<i>n</i> is more than 1, or blank otherwise.
</ul> </li>
</ul>
 
<li>This line is always printed if there are any nondate values for the field.
<li>This line is always printed if there are any non-date values for the field.
The line has one of the two following forms:
The line has one of the two following forms:
<ol>
<ul>
<li><i>nsmp</i> occurrences of nondate value (<i>len</i>):
<li><i>nsmp</i> occurrences of nondate value (<i>len</i>):
<i>truncated_value</i> <i>trunc_flag</i>
<i>truncated_value</i> <i>trunc_flag</i> </li>
<li><i>dist</i> distinct nondate values
 
</ol>
<li><i>dist</i> distinct non-date values </li>
<p></p>
</ul>  
Where <i>nsmp</i> is the number of occurrences of a nondate value, if it appears
<p>
to be exactly one nondate value in the field, and <i>len</i> is its length and
Where <i>nsmp</i> is the number of occurrences of a non-date value, if it appears
to be exactly one non-date value in the field, and <i>len</i> is its length, and
<i>truncated_value</i> is the first 22 characters of its value.
<i>truncated_value</i> is the first 22 characters of its value.
<i>Trunc_flag</i> is
<i>trunc_flag</i> is the first 22 bytes of its value, if the length is greater than 22.
<b>(first 22 bytes)</b> if the length is greater than 22.
In fact, some of the non-date values in the field may differ, if their first 22 characters are
In fact, some of the
the same.</p>
nondate values in the field may differ, if their first 22 characters are
<p>
the same.
If there are two or more non-date values in the field, then the
<p></p>
If there are 2 or more nondate values in the field, then the
second form of this line is presented, where <i>dist</i>
second form of this line is presented, where <i>dist</i>
is the number of different
is the number of different non-date values that Fast Unload has kept as samples (up to the maximum of 20).</p> </li>
nondate values that Fast Unload has kept as samples (up to the maximum of 20).
</ol>
</ol>
<p></p>
<p class="note"><b>Note:</b> For the recommended <var>CENTSPAN</var>,
Note that for the recommended CENTSPAN,
<var class="product">Fast/Unload</var> assumes that all two-digit years occur in the 1900s, or, if running <var>DATESTAT</var> after 1999, 99 years before
<var class="product">Fast/Unload</var> assumes that all 2-digit years occur in the 1900s, or, if running
the date of the run up to and including the date of the run. </p>
DATESTAT after 1999, 99 years before
 
the date of the run up to and including the date of the run.
==DATESTAT DETAIL==
==DATESTAT DETAIL==
DATEST DETAIL creates a report with 1 page for each date field, which
DATEST DETAIL creates a report with 1 page for each date field, which

Revision as of 21:06, 24 February 2015

If the [[Fast/Unload Extraction_Language (FUEL)#DATESTAT [SUMMARY | DETAIL]|DATESTAT]] statement is present in the FUNIN data set, Fast/Unload will determine which fields in the file contain date values. The determination of whether a field contains a date value is done in two passes:

  • The first pass examines 1000 evenly-distributed records in the file.
  • The second pass analyzes all records.

At the end of each pass, certain fields are retained for date analysis and reporting. A field is retained if:

  1. For pass one, the field is not found in the 1000 records.
  2. At least one field value that conforms to a date format is found in the pass, except:

    A field is not a date if all dates were all numeric, there were more than 5 distinct non-date values, and fewer than 50% of the instances are dates. This is an attempt to avoid situations in which a field such as zip code could be treated as a 5-digit (YYDDD) date.

Note that Blob fields are not candidates for DATESTAT analysis.

The analysis keeps tracks of various totals that are used in reporting, and also keeps some of the values found in the field. Up to 36 date formats, 20 non-date values, and 120 year-samples will be kept. If these overflow, the least-recently-found year and non-date samples are discarded, and the most-recently-found date format sample is discarded.

Note: Since only as many as 22 characters of non-date values are kept, two different values that are the same in the first 22 characters are considered to be the same value.

The date formats that are searched for consist of the following list, plus each one of the formats in this list, followed by a blank and time in the form HH:MI:SS, if the date format contains a character other than M, D, or Y, or followed immediately by time in the form HHMMSS otherwise.

MON DAY YY MON DAY YYYY DAY MON YY DAY MON YYYY DAY MONTH YY DAY MONTH YYYY DAY MON, YY DAY MON, YYYY DAY MONTH, YY DAY MONTH, YYYY DDMMYY DDIMMIYY DDMMYYYY DDIMMIYYYY MONTH DAY YY MONTH DAY YYYY MMDDYY MMIDDIYY MMDDYYYY MMIDDIYYYY YYDDD YY MON DAY YY MONTH DAY YYMMDD YYIMMIDD YYYYDDD YYYY MON DAY YYYY MONTH DAY YYYYMMDD YYYYIMMIDD

For the meaning of the components of these formats, see Datetime formats.

DATESTAT reporting

This section describes the reports created by the DATESTAT SUMMARY and DATESTAT DETAIL statements. Both of these statements indicate something about the "quality" of the date data in the field. The purposes of "date field quality" are:

  • If you are running DATESTAT SUMMARY, and you have some values other than pure, you may want to do further investigation of the date fields.
  • To indicate how much work might be involved to resolve the various values stored in the field. One tool to resolve the values is to run DATESTAT DETAIL. Doing some ad-hoc work with SOUL is another approach. The "worse" the quality of a field, the more work is likely to be required to resolve questions about the field values.

The quality is expressed as pure, good, fair, or poor. It is an attempt to measure the possible level of effort required to correct data on the file. The terms have the following meanings:

Pure There are only date values, and all with a single date format.
Poor Either of these:
  • There are more than 10 distinct non-date values and more than .01% of the field occurrences are non-date values.
  • The percentage of date values that have uncommon formats, times the number of uncommon formats, is greater than .01%, or there are more than 20 date formats.

If there are more than 20 date formats, or if the ratio of occurrences of the most common date format to occurrences of the next most common date format is less than 10 to 1, then Fast/Unload prints the string "Common date format not found".

Fair Either of these:
  • There are more than 5 distinct non-date values and more than .001% of the field occurrences are non-date values.
  • The percentage of date values that have uncommon formats, times the number of uncommon formats, is greater than .001%.
Good Anything else.

DATESTAT SUMMARY

DATESTAT SUMMARY creates a report with 1-3 lines for each date field, in the following form:

  1. ftag format (qual) span field...n: name
  2. tot occurrences of field format count
  3. nsmp occurrences of nondate value (len len): sample

Where:

  1. This line is always present; the components are:
    • ftag is either "Common date format not found", if there are more than 20 date formats, or "Common format:" otherwise.
    • format is the most commonly occurring date format, if ftag is "Common format:", or blank otherwise.
    • qual is either "pure", "good", "fair", or "poor".
    • span is either: CENTSPAN: YYYY
      or No YY occurrences
      The former gives a recommended CENTSPAN, if the field has any 2-digit years, where YYYY is the oldest 2-digit year found; the latter occurs if the field does not have any 2-digit years. (2-digit years are interpreted using a CENTSPAN of 1900, or, if running DATESTAT after 1999, a CENTSPAN of -99.)
    • n is a sequential numbering of the fields; this can be correlated to an FSTATS report.
    • name is the name of the field.
  2. This line is always printed if the qual is not pure. The components are:
    • tot is the total number of occurrences of the field in the file
    • format count is either n different formats found, if n is more than 1, or blank otherwise.
  3. This line is always printed if there are any non-date values for the field. The line has one of the two following forms:
    • nsmp occurrences of nondate value (len): truncated_value trunc_flag
    • dist distinct non-date values

    Where nsmp is the number of occurrences of a non-date value, if it appears to be exactly one non-date value in the field, and len is its length, and truncated_value is the first 22 characters of its value. trunc_flag is the first 22 bytes of its value, if the length is greater than 22. In fact, some of the non-date values in the field may differ, if their first 22 characters are the same.

    If there are two or more non-date values in the field, then the second form of this line is presented, where dist is the number of different non-date values that Fast Unload has kept as samples (up to the maximum of 20).

Note: For the recommended CENTSPAN, Fast/Unload assumes that all two-digit years occur in the 1900s, or, if running DATESTAT after 1999, 99 years before the date of the run up to and including the date of the run.

DATESTAT DETAIL

DATEST DETAIL creates a report with 1 page for each date field, which includes:

  1. The number of field occurrences.
  2. The number of date occurrences, with the minimum and maximum date value, for both 4 digit ("YYYY") and 2 digit ("YY") years.
  3. A sample of the discovered date formats.
  4. A sample of the year values occurring in the field.
  5. A sample of the non-date values occurring in the field.

The sampling rules are described in Fast/Unload DATESTAT analysis; some values may be discarded. An asterisk (*) is printed after a sample if the sample occurrence count is incomplete.

Note that for the recommended CENTSPAN and the min/max values of the DETAIL report, Fast/Unload assumes that all 2-digit years occur in the 1900s, or, if running DATESTAT after 1999, 99 years before the date of the run up to and including the date of the run.

See also

Fast/Unload topics