|
Program
Overview
This program is used to validate a text file that contains a series
of variable length transaction records. The validation process is
different for each type of transaction, only the following types
of transaction are acceptable and deemed valid -
|
I |
Issue |
-
Stock issued. |
| R
|
Receipt |
-
Stock received. |
| C |
Creation |
-
Create a new customer record. |
| D |
Deletion |
-
Delete an existing customer record. |
All invalid transactions are reported on the printer under suitable
headings, with an appropriate error code. All error codes are defined
on the last page of the printout. All valid transactions are written
to the disk file named 494792VF.DAT for further processing by the
Sorting program (in text format). This is unless the user changes
this default file name by entering additional program parameters
at the command line.
The text file which contains the transaction records must be named
494792TD.DAT, and be located in the same directory from where the
validation program is located and executed from. This is unless
the user changes this default file name by entering additional program
parameters at the command line. Below describes how the default
file names may be overridden: -
494792P1.exe <transaction file> <validated file>
<printer>
The
default file names are as follows: -
Transaction file 494792TD.DAT
Validation file - 494792VF.DAT
Printer - PRN
If the user wishes to override one of these files they must also
enter the file names of all the files preceding it. For example
to override the printer to a text file named test.txt, they must
enter the following command: -
494792P1.exe
494792TD.DAT 494792VF.DAT test.txt
However if the user only wishes to change the name of the file which
contains the transactions to validate, they may enter the following
command: -
494792P1.exe
TRANS.DAT
Valid
Transaction Types
A valid
Issue transaction must be comprised of the following -
- Record
Type Must be I
- Customer
Code Must be 4 Digits, with an alphanumeric Modulus 11 check
digit (weighting factor of 5432) appended to it (i.e. 10006)
- Part
Number - Must be 5 Digits, with an alphanumeric Modulus 11 check
digit (weighting factor of 65432) appended to it (i.e. 010006)
- Issue
Quantity A numeric value
A valid
Receipt transaction must be comprised of the following -
- Record
Type Must be R
- Customer
Code Must be 4 Digits, with an alphanumeric Modulus 11 check
digit (weighting factor of 5432) appended to it (i.e. 10006)
- Part
Number - Must be 5 Digits, with an alphanumeric Modulus 11 check
digit (weighting factor of 65432) appended to it (i.e. 010006)
- Receipt
Quantity A numeric value
A valid
Deletion transaction must be comprised of the following -
- Record
Type Must be D
- Customer
Code Must be 4 Digits, with an alphanumeric Modulus 11 check
digit (weighting factor of 5432) appended to it (i.e. 10006).
A valid
Creation transaction must be comprised of the following -
- Record
Type Must be C
- Customer
Code Must be 4 Digits,
with an alphanumeric Modulus 11 check digit (weighting factor
of 5432) appended to it (i.e. 10006)
- Customer
Name Maximum of 20 characters in length, and NOT BLANK
- Customer
Address 4 address parts each separated by a ;, maximum
of 60 characters
- Customer
Balance 9 numeric characters, which represent the following
format 9(7)v99
- Credit
limit 7 numeric characters, which represent the following format
9(7)
The
following errors are detected and handled by the validation program:
-
Unknown transaction type, only I, R, C and D transactions
are allowable.
Non numeric customer code, only the check digit may be alphanumeric.
Incorrect customer code check digit, not modulus 11 of customer
code.
Non numeric part number, only the check digit may be alphanumeric.
Incorrect part number check digit, not modulus 11 of part number.
Non numeric quantity.
Customer address incorrect format.
Non numeric customer balance.
Non numeric credit limit.
Customer name missing, there must be an address entered.
Missing part number.
Customers address missing, there must be a name entered.
There was too much information given for the type of transaction.
Back
Home
|