Integrity constraints were introduced with version 7 of SAS® software. In essence, they are rules that define the valid forms of your data. The rules can be defined in a number of ways and will be respected by SAS software whenever there is an attempt to update the data set.
You can create five different types of integrity constraint rules:
- A column can contain only non-null values.
- A column can contain only values that fall within a specific set, range, or list of values, or that duplicate a value in another column in the same row.
- A column can contain only values that are unique.
- A column that is a primary key can contain only values that are unique and that are not missing values.
- A column that is a foreign key (the child) can contain only values that are present in the associated primary key (the parent) or null values. A column that is a primary key can contain only values that cannot be deleted or changed unless the same deletions or changes have been made in values of the associated foreign key. Values of a foreign key can be set to null, but values cannot be added unless they also exist in the associated primary key.