CHECK-SUM Command

The CHECK-SUM command provides statistical information on all or specified items in a file. This information includes the total number of bytes, the average number of bytes, the number of items check-summed, the check-sum, and the bit count. Check-sums are useful for determining whether data in a file has been changed.

Format

CHECK-SUM [DICT] filename [item-list] [attribute-name] [selection]

Parameter(s)

DICT

Specifies the file dictionary.

filename

Name of the file.

item-list

List of item-IDs. If an item-list is not specified, all items are check-summed.

attribute-name

Specifies one particular attribute. If an attribute is not specified, the D-pointer to the data file is used. If there is no default, or if the attribute marker is 9999, the entire item is included.

selection

Specifies one or more conditions an item must meet to be included. For a complete description of selection expression syntax, see the LIST Command.

Description

To use check-sums, run the CHECK-SUM command on all files or portions of files to be verified, and keep a copy of the output statistics. Whenever the CHECK-SUM command is subsequently run, compare the new check-sum to the old one. If the check-sums are identical, the items have not changed. Remember to rerun the CHECK-SUM command whenever the file is changed in any way.

The check-sum is calculated by multiplying the binary value of each character by its positional value. The product has a high probability of being unique for any given character string. The check-sum is the arithmetic total, minus overflow, of all bytes in the selected items.

When you run the CHECK-SUM command, its output is displayed in the following format:

BYTE STATISTICS FOR filename | attribute

TOTAL = bytes  AVERAGE = avg-bytes  ITEMS = items  CKSUM = cksum  BITS = count

The CHECK-SUM display provides the following information based on the items processed:

filename/ attribute

Name of the file or attribute for which the statistics are produced.

bytes

Total number of bytes for the element stored in the attribute or item.

avg-bytes

Average number of bytes.

count

Number of items check-summed.

cksum

The check-sum.

count

Bit count for the elements stored in the attribute or item.

Using CHECK-SUM

The following example shows a check-sum for a file called CUSTOMERS:

>CHECK-SUM CUSTOMERS

 

BYTE STATISTICS FOR : CUSTOMERS TOTAL = 119  AVERAGE = 10.81  ITEMS = 11  CKSUM = -404163063996 BITS=11

 

>