Question: This lab will use an input file named lab5-in.dat that is formatted as the patient file used earlier. This file will be located in the

This lab will use an input file named lab5-in.dat that is formatted as the patient file used earlier. This file will be located in the same directory as the executables (do not specify a path for the file in the Select statements). Your OpenCOBOL program, named lab5.cob, will produce a data quality report for the input file. It will examine each record to determine if it fails to meet certain criteria. The report is only to show records with error(s). It is possible that a record will have no errors, one error, or multiple errors. A single variable on a record will have at most one error.The report will be written to a file named "lab5- out.dat." This file will be located in the same directory as the executables (do not specify a path for the file in the Select statements). The output file will look something like this:

Non-numeric Patient Number found on the following record:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Negative Patient Number found on the following record:

Invalid Gender found on the following record:

Non-Numeric Claim Amount found on the following record:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Number of records with errors: 2

Total number of errors: 4

A few things to note:

The record is printed in one piece; the fields are not split into columns.

A record with multiple errors is only printed once. A separate message for each error detected on that record will be printed, then the record is printed. This means that you read a record and apply each check on it. You do not perform the first check on each record, then the second check on each record, etc.

A record with no errors is not on the report at all

Do not concern yourself with pages and headers

The report ends with two counts

You may need to change some variable definitions from what you used earlier

The errors you are to detect:

Non-numeric Hospital Number

Negative Hospital Number

Non-numeric Patient Number

Negative Patient Number

Invalid Gender (valid values are in the PDF file that describes the patient file. Is OK to be upper or lower case)Non-Numeric Birth Date

Birth D ate is not a valid date (it is not an actual date, like 13011980)Birth Date is in the future (after the current date)

Secondary insurance has a value when primary insurance is spaces

Primary and secondary insurance have the same value

Non-alphabetic Treatment

Treatment Date is not a valid date (it is not an actual date, like 1301)Treatment Time is not a valid time (it is not an actual time, like 2710)

Non-numeric Claim Amount

Negative Claim Amount You are to use:

At least one class test

At least one relation test

At least one sign test

At least one custom class

Tip: There are situations where you are to validate that certain values are not negative. Remember that the concept of negative/positive/zero only applies to numbers. Do not try to apply these concepts on non-numbers. The date validation requires some thought as well. In order to be a valid date, the value must be numeric. In order to compare it to an actual date, it must be a valid date.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!