Fast/Unload DATESTAT analysis: Difference between revisions
m (minor formatting) |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==DATESTAT sampling== | ==DATESTAT sampling== | ||
If the <var>[[Fast/Unload Extraction Language (FUEL)#datestat|DATESTAT]]</var> statement is present in the <code>FUNIN</code> data set, | If the <var>[[Fast/Unload Extraction Language (FUEL)#datestat|DATESTAT]]</var> statement is present in the <code>FUNIN</code> data set, | ||
Line 33: | Line 32: | ||
are considered to be the same value.</p> | are considered to be the same value.</p> | ||
<p> | <p> | ||
The date formats that are searched for | The date formats that are searched are listed below, in somewhat arbitrary groupings for visual distinction. Each item in the list represents two formats: </p> | ||
<ul> | |||
<li>Format one is the terms that precede the square brackets.</li> | |||
<li>Format two is format one plus the immediately following square-bracketed contents.</li> | |||
</ul> | |||
<p class="code">MON DAY YY | <p class="code">MON DAY YY[ HH:MI:SS] | ||
MON DAY YYYY | MON DAY YYYY[ HH:MI:SS] | ||
DAY MON YY | DAY MON YY[ HH:MI:SS] | ||
DAY MON YYYY | DAY MON YYYY[ HH:MI:SS] | ||
DAY MONTH YY | DAY MONTH YY[ HH:MI:SS] | ||
DAY MONTH YYYY | DAY MONTH YYYY[ HH:MI:SS] | ||
DAY MON, YY | DAY MON, YY[ HH:MI:SS] | ||
DAY MON, YYYY | DAY MON, YYYY[ HH:MI:SS] | ||
DAY MONTH, YY | DAY MONTH, YY[ HH:MI:SS] | ||
DAY MONTH, YYYY | DAY MONTH, YYYY[ HH:MI:SS] | ||
DDMMYY | |||
DDIMMIYY | DDMMYY[HHMISS] | ||
DDMMYYYY | DDIMMIYY[HHMISS] | ||
DDIMMIYYYY | DDMMYYYY[HHMISS] | ||
MONTH DAY YY | DDIMMIYYYY[HHMISS] | ||
MONTH DAY YYYY | |||
MMDDYY | MONTH DAY YY[ HH:MI:SS] | ||
MMIDDIYY | MONTH DAY YYYY[ HH:MI:SS] | ||
MMDDYYYY | MMDDYY[HHMISS] | ||
MMIDDIYYYY | MMIDDIYY[HHMISS] | ||
YYDDD | MMDDYYYY[HHMISS] | ||
YY MON DAY | MMIDDIYYYY[HHMISS] | ||
YY MONTH DAY | YYDDD[HHMISS] | ||
YYMMDD | |||
YYIMMIDD | YY MON DAY[ HH:MI:SS] | ||
YYYYDDD | YY MONTH DAY[ HH:MI:SS] | ||
YYYY MON DAY | |||
YYYY MONTH DAY | YYMMDD[HHMISS] | ||
YYYYMMDD | YYIMMIDD[HHMISS] | ||
YYYYIMMIDD | YYYYDDD[HHMISS] | ||
YYYY MON DAY[ HH:MI:SS] | |||
YYYY MONTH DAY[ HH:MI:SS] | |||
YYYYMMDD[HHMISS] | |||
YYYYIMMIDD[HHMISS] | |||
</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]]. | ||
==DATESTAT reporting== | ==<b id="dtrep"></b>DATESTAT reporting== | ||
This section describes the reports created by the <var>DATESTAT SUMMARY</var> | This section describes the reports created by the <var>DATESTAT SUMMARY</var> | ||
and <var>DATESTAT DETAIL</var> statements. | and <var>DATESTAT DETAIL</var> 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: | <p> | ||
The purposes of "date field quality" are:</p> | |||
<ul> | <ul> | ||
<li>If you are running <var>DATESTAT SUMMARY</var>, and you have some values other | <li>If you are running <var>DATESTAT SUMMARY</var>, and you have some values other | ||
Line 111: | Line 113: | ||
</ul> | </ul> | ||
<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 | 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 <code>Common date format not found.</code></p></td></tr> | ||
<tr><th>Fair</th> | <tr><th>Fair</th> | ||
<td>Either of these: | <td>Either of these: | ||
<ul> | <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>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> | <li>The percentage of date values that have uncommon formats, times the number of uncommon formats, is greater than .001%.</li> | ||
Line 125: | Line 127: | ||
</table> | </table> | ||
==DATESTAT SUMMARY== | ===DATESTAT SUMMARY=== | ||
<var>DATESTAT SUMMARY</var> creates a report with | <var>DATESTAT SUMMARY</var> creates a report with one to three lines for each date field, in | ||
the following form: | the following form: | ||
<ol> | <ol> | ||
Line 142: | Line 144: | ||
<li>This line is always present; the components are: | <li>This line is always present; the components are: | ||
<ul> | <ul> | ||
<li><i>ftag</i> | <li><i>ftag</i> is: "Common date format not found," if there are more than | ||
is | 20 date formats, or it is "Common format:" otherwise. </li> | ||
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. </li> | if <i>ftag</i> is "Common format:", or it is blank otherwise. </li> | ||
<li><i>qual</i> is | <li><i>qual</i> is "pure," "good," "fair," or "poor." </li> | ||
<li><i>span</i> is either of these: | <li><i>span</i> is either of these: | ||
Line 155: | Line 156: | ||
<li><code>CENTSPAN: <i>YYYY</i></code></li> | <li><code>CENTSPAN: <i>YYYY</i></code></li> | ||
<li>No YY occurrences</li> | <li>No <i>YY</i> occurrences</li> | ||
</ul> | </ul> | ||
<p> | <p> | ||
Line 175: | Line 176: | ||
<li><i>tot</i> is the total number of occurrences of the field in the file. </li> | <li><i>tot</i> is the total number of occurrences of the field in the file. </li> | ||
<li><i>format count</i> is | <li><i>format count</i> is: <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 it is blank otherwise. </li> | ||
</ul> </li> | </ul> </li> | ||
Line 189: | Line 190: | ||
<p> | <p> | ||
Where <i>nsmp</i> is the number of occurrences of a non-date value, if it appears | 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 | to be exactly one non-date value in the field; <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 the first 22 bytes of its value, if the length is greater than 22. | <i>trunc_flag</i> is the first 22 bytes of its value, if the length is greater than 22. | ||
Line 195: | Line 196: | ||
the same.</p> | the same.</p> | ||
<p> | <p> | ||
If there are two or more non-date values in the field, | If there are two or more non-date values in the field, the second form of this line is presented, where <i>dist</i> is the number of different non-date values that Fast Unload has kept as samples (up to the maximum of 20).</p> </li> | ||
second form of this line is presented, where <i>dist</i> | |||
is the number of different non-date values that Fast Unload has kept as samples (up to the maximum of 20).</p> </li> | |||
</ol> | </ol> | ||
<p class="note"><b>Note:</b> For the recommended <var>CENTSPAN</var>, | <p class="note"><b>Note:</b> For the recommended <var>CENTSPAN</var>, | ||
Line 203: | Line 202: | ||
the date of the run up to and including the date of the run. </p> | the date of the run up to and including the date of the run. </p> | ||
==DATESTAT DETAIL== | ===DATESTAT DETAIL=== | ||
<var>DATESTAT DETAIL</var> creates a report with one page for each date field, which | |||
includes: | includes: | ||
<ol> | <ol> | ||
<li>The number of field occurrences. </li> | <li>The number of field occurrences. </li> | ||
<li>The number of date occurrences, with the minimum and maximum date | <li>The number of date occurrences, with the minimum and maximum date | ||
value, for both | value, for both four-digit ("YYYY") and two-digit ("YY") years. </li> | ||
<li>A sample of the discovered date formats. </li> | <li>A sample of the discovered date formats. </li> | ||
<li>A sample of the year values occurring in the field. </li> | <li>A sample of the year values occurring in the field. </li> | ||
<li>A sample of the non-date values occurring in the field. </li> | <li>A sample of the non-date values occurring in the field. </li> | ||
</ol> | </ol> | ||
Line 218: | Line 221: | ||
may be discarded. An asterisk (<tt>*</tt>) is printed after a sample if | may be discarded. An asterisk (<tt>*</tt>) is printed after a sample if | ||
the sample occurrence count is incomplete.</p> | the sample occurrence count is incomplete.</p> | ||
< | <blockquote class="note"> | ||
<b>Note:</b> For the recommended <var>CENTSPAN</var> and the | <b>Note:</b> For the recommended <var>CENTSPAN</var> and the minimum/maximum values of the <var>DETAIL</var> report, <var class="product">Fast/Unload</var> assumes that all two-digit years occur either: | ||
the date of the run | <ul> | ||
<li>In the 1900s</li> | |||
<li>99 years before the date of the run (up to and including the date of the run), <b><i>if</i></b> running <var>DATESTAT</var> after 1999 </li> | |||
</ul> | |||
</blockquote> | |||
==See also== | ==See also== | ||
{{Template:Fast/Unload topic list}} |
Latest revision as of 22:45, 4 August 2016
DATESTAT sampling
If the 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:
- For pass one, the field is not found in the 1000 records.
- At least one field value that conforms to a date format is found in the pass being performed, 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 of the field 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.
- The field is not a Blob field. Such 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 are listed below, in somewhat arbitrary groupings for visual distinction. Each item in the list represents two formats:
- Format one is the terms that precede the square brackets.
- Format two is format one plus the immediately following square-bracketed contents.
MON DAY YY[ HH:MI:SS] MON DAY YYYY[ HH:MI:SS] DAY MON YY[ HH:MI:SS] DAY MON YYYY[ HH:MI:SS] DAY MONTH YY[ HH:MI:SS] DAY MONTH YYYY[ HH:MI:SS] DAY MON, YY[ HH:MI:SS] DAY MON, YYYY[ HH:MI:SS] DAY MONTH, YY[ HH:MI:SS] DAY MONTH, YYYY[ HH:MI:SS] DDMMYY[HHMISS] DDIMMIYY[HHMISS] DDMMYYYY[HHMISS] DDIMMIYYYY[HHMISS] MONTH DAY YY[ HH:MI:SS] MONTH DAY YYYY[ HH:MI:SS] MMDDYY[HHMISS] MMIDDIYY[HHMISS] MMDDYYYY[HHMISS] MMIDDIYYYY[HHMISS] YYDDD[HHMISS] YY MON DAY[ HH:MI:SS] YY MONTH DAY[ HH:MI:SS] YYMMDD[HHMISS] YYIMMIDD[HHMISS] YYYYDDD[HHMISS] YYYY MON DAY[ HH:MI:SS] YYYY MONTH DAY[ HH:MI:SS] YYYYMMDD[HHMISS] YYYYIMMIDD[HHMISS]
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:
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 |
Fair | Either of these:
|
Good | Anything else. |
DATESTAT SUMMARY
DATESTAT SUMMARY creates a report with one to three lines for each date field, in the following form:
- ftag format (qual) span field...n: name
- tot occurrences of field format count
- nsmp occurrences of non-date value (len len): sample
Where:
- This line is always present; the components are:
- ftag is: "Common date format not found," if there are more than 20 date formats, or it is "Common format:" otherwise.
- format is the most commonly occurring date format, if ftag is "Common format:", or it is blank otherwise.
- qual is "pure," "good," "fair," or "poor."
- span is either of these:
CENTSPAN: YYYY
- No YY occurrences
The former gives a recommended CENTSPAN, if the field has any two-digit years, where YYYY is the oldest two-digit year found. The latter occurs if the field does not have any two-digit years. Two-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.
- 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: n different formats found (if n is more than 1), or it is blank otherwise.
- 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 non-date 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; 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, 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
DATESTAT DETAIL creates a report with one page for each date field, which includes:
- The number of field occurrences.
- The number of date occurrences, with the minimum and maximum date value, for both four-digit ("YYYY") and two-digit ("YY") years.
- A sample of the discovered date formats.
- A sample of the year values occurring in the field.
- A sample of the non-date values occurring in the field.
The sampling rules are described in DATESTAT sampling; some values may be discarded. An asterisk (*) is printed after a sample if the sample occurrence count is incomplete.
Note: For the recommended CENTSPAN and the minimum/maximum values of the DETAIL report, Fast/Unload assumes that all two-digit years occur either:
- In the 1900s
- 99 years before the date of the run (up to and including the date of the run), if running DATESTAT after 1999
See also
- Fast/Unload overview
- Fast/Unload invocation
- Fast/Unload program parameters
- Fast/Unload Extraction Language (FUEL)
- Fast/Unload standard #functions
- Fast/Unload BLOB/CLOB processing considerations
- Fast/Unload datetime processing considerations
- Fast/Unload DATESTAT analysis
- Fast/Unload job statistics
- Fast/Unload SOUL Interface
- Fast/Unload with an external sort package
- Fast/Unload with DBCS data
- Fast/Unload customer-written assembler #function packages
- Fast/Unload user exits or filters
- Fast/Unload with Model 204 file groups
- Fast/Unload with Model 204 fieldgroups
- Fast/Unload with the Sir2000 Field Migration Facility
- Fast/Unload floating point arithmetic and numeric conversion
- Fast/Unload program return codes
- Fast/Unload installation
- Fast/Unload customization of defaults
- Fast/Unload SMF record format
- Fast/Unload release notes
- Fast/Unload messages