Analyzing Statements and Categorizing Them | Reporting on the Date Issues |
The tutorial in this chapter explains year types and shows how to adjust them.
Every statement in the worksheet is now categorized according to whether or not it is a problem. Each statement has either the A-Yes or A-No category.
The next stage is to examine the data items that are used in the statements that are a problem. You need to check the year types of those data items to make sure they are assigned correctly, and that they are used consistently. If they are not, you need to adjust them. Your focus of attention depends on whether you are verifying applications or you intend to fix them, as follows:
The aim of this tutorial is to finalize the year types of the data items in the worksheet, so that you are ready for running final reports and fixing.
In this tutorial, you:
This tutorial takes about 30 minutes.
This section explains how to run the tutorial for the first time and how to reset everything so that you can restart the tutorial.
If you are continuing immediately from the last tutorial, you can skip this Preparation section and go straight to next main section in this chapter, Deducing Categories from the Statements.
If you stopped following the tutorials, open the Tour project and the default worksheet, as before, and check that your options are set correctly for the tutorials. For details, see the sections Setting the Analysis Tools Options and Setting the Worksheet Options in the chapter Finding and Adding Dates to the Worksheet.
The worksheet should contain 53 data items and 119 statements.
If you have already started this tutorial and now want to restart it, you need to reopen the backup worksheet that you made at the end of the previous tutorial. To do this:
Depending on how you have Windows set up, the worksheet names are displayed with or without the .mdb extension.
The title bar of the worksheet now shows Worksheet - Tour, and you can work on this leaving the backup EndofChap7.mdb intact in case you need it again.
The worksheet contains 53 data items and 119 statements.
Now that you have decided which statements are of interest, you can conclude that the data items in those statements are accordingly of interest.
In this section, you take the statements of interest with the A-Yes category and apply that category to the data items used in those statements.
This shows the 22 filtered data items in the worksheet that are used in those statements.
This shows the 31 filtered data items that are not of interest.
This shows the 22 filtered data items of interest.
This section explains the year types that were automatically assigned to the data items, when you added them to the worksheet. If you understand year types and their implications on the data items, you can more easily decide whether a data item is already handled correctly or whether it needs fixing in some way.
How a data item should be expanded depends, among other things, on its logical date format (such as yymmdd or ccyy) and its physical format, such as numeric or alphanumeric, as defined in its PICTURE. Usually, a data item holds data of only one logical format and only one physical format. In this case, SmartFind Plus has automatically assigned year types based on rules for the data items' PICTUREs.
Year types are used to fix statements and to identify statements that involve data items with differing date formats. Year types also show in reports and audit trails.
In this section you review some of the year types assigned to data items in the worksheet.
P-YEARS-TO-REPORT
, which holds
a duration.
P-YEARS-TO-REPORT
and change its year
type to NOTDATE.YR-START-DATE
does not indicate whether
the date format is yymmdd or ddmmyy.
YR-START-DATE
hold?
YR-START-DATE
is moved into RD-START-DATE-N
, whose data definition
shows the date format to be yymmdd. From this, you know that the
year type of YR-START-DATE
should be YYMMDD9.
The reason that YR-START-DATE
was not
automatically assigned this year type is that RD-START-DATE-N
is not in the worksheet, because it is not a problem in its own
right.
WS*DATE
, which also have the
year type ______9. Notice that they are used in MOVE statements with a
data item YYMMDD
.
You might wonder why the WS*DATE
data items do not
automatically have the correct year types. This is because the year
types are assigned as each data item is added to the worksheet. Data
items added early in the adding process might not receive full year
types, which then become obvious when data items are added later in
the process. In this case, the WS*DATE
items were added
early on and YYMMDD
was added later on.
Now that all the data items are added, you can resolve some of the remaining year type ambiguities by running a year type assignment, as follows:
Notice that the data items WS*DATE now have the year types YYMMDD9.
MONTHS-ELAPSED-SINCE-JAN-1900
.
YYYY
does hold the century and so is correctly
assigned CCYY9.TMP-END-YY
does not hold the century. It holds the
year without the century, even though it can hold four digits. TMP-END-YY
to YY9.All the data items of interest are now assigned year types.
If a statement uses data items that have different year types, there might be a problem. If you are verifying, the fix in the statement might be incorrect. If you are intending to fix the statement, the fix that is automatically for the statement might be incorrect.
In either case, it is possible that one or other of the data items is assigned the wrong year type. You need to check for these mismatched year types and either confirm the mismatches as OK or correct the offending year types.
In this section, you run a Consistency check to find the statements containing data items with different year types.
This produces a report of the inconsistencies and a set of the statements that contain data items with mismatched year types. The report is shown in Figure 8-1.
Figure 8-1: Consistency Check
YR-START-DATE
,
which has the year type YYMMDD9, is used in three ADD statements with
the data item TMP-YYYY
, which has the year type MANUAL.
Since the two data items have different year types these statements are
considered to conflict.
Why is the MANUAL year type used for TMP-YYYY
?
If you cannot remember why, look up the notes for TMP-YYYY
.
To do this, right click the data item in the first line of the
conflict and click Go to details, and look in the Notes
column. Since this data item needs handling differently in different
statements, the MANUAL year type is correct and the mismatch is valid.
A later section examines the inconsistencies in more detail.
You need to examine the mismatches, and you can do this by systematically going through the report and recording your decisions and changes in the worksheet. However, it is easier to do this in the worksheet, in which case you first need to record these inconsistencies in the worksheet.
This section updates the categories of the mismatching statements, using the Worksheet channel.
There are now 11 statements with mismatching year types.
Now that the statements with mismatched year types are categorized in the worksheet, you need to examine them one by one and resolve the mismatches.
TMP-YYYY
have the MANUAL year type? Look
in the Notes column. MANUAL means that the year type for the data item needs to be manually assigned for each statement, since the data item holds different date formats in different statements. This means that this inconsistency is valid.
Use Select Category for these statements to:
COMPUTE SUB2
.
SUB2
have? Use F3 to find out.SUB2
?
Examine the statement to find out.The data item SUB2
has the year type NOTDATE, but in
this statement it holds a two-digit year. This means that the
consistency check has uncovered a genuine problem. The year type of
SUB2
needs to allow for non-dates and for years.
SUB2
and change its year type to MANUAL.
Note that you must add the new category before removing the old one, because removing causes the statement to be hidden from the active filter view.
There are now 7 filtered statements.
There are now no filtered statements.
This shows that all the inconsistencies are resolved.
The worksheet should now contain 53 data items and 119 statements. 17 of the statements have the category A-Yes and 11 have the category S-DateMsMatchOK.
The worksheet is persistent and is continually saved. However, it is good practice to save a backup of the worksheet from time to time.
If you already have a backup with this name, give a new name such as EndofChap8-1.
You can close SmartFind Plus, if you want to stop for now. You can then continue with the next tutorial some other time.
Analyzing Statements and Categorizing Them | Reporting on the Date Issues |