docs(validations): a range rule ignores a missing value

Three corrections to the special missing section:

- the period is optional: a special missing is typed as `a` or `.a`, `_` or `._`
- MINVAL and MAXVAL both accept a missing value, and both still reject a real
  number that is out of range. A minimum constrains a number, and a missing is
  not a number - NOTNULL is the rule for a column that must be populated
- only NOTNULL and the formulas actually reject a special missing, so the
  "not supported" summary is replaced with what does reject it and what does not
This commit is contained in:
dc
2026-09-23 21:01:11 +00:00
parent 1a5cea9ebe
commit 66c48a4cc7
+6 -6
View File
@@ -47,7 +47,7 @@ Check back frequently as we keep growing this list of checks. For how each rule
## Special Missing Values ## Special Missing Values
A SAS numeric variable has 28 missing values: the regular `.` and 27 special ones (`.A`-`.Z` and `._`). Data Controller accepts them in a numeric cell as a bare letter - `a` to `z`, or `_`, with no period - and stores the matching special missing in SAS. A SAS numeric variable has 28 missing values: the regular `.` and 27 special ones (`.A`-`.Z` and `._`). Data Controller accepts them in a numeric cell as a letter - `a` to `z` - or an underscore, with or without a leading period (`a`, `.a`, `_`, `._`), and stores the matching special missing in SAS. The period is optional, and a plain `.` stores the regular missing.
A numeric column that carries a date, datetime or time format is the exception. Those cells are edited through a date picker rather than the numeric editor, and the picker accepts only a date - so a special missing cannot be typed into one of them. A numeric column that carries a date, datetime or time format is the exception. Those cells are edited through a date picker rather than the numeric editor, and the picker accepts only a date - so a special missing cannot be typed into one of them.
@@ -55,9 +55,9 @@ The rules treat a special missing as a value for some checks and as a missing va
|Rule|What happens to a special missing| |Rule|What happens to a special missing|
|---|---| |---|---|
|NOTNULL|Fails. A special missing is null to a NOT NULL (or primary key) constraint, and a real SAS NOT NULL constraint on the target table rejects it too.| |NOTNULL|Fails. A special missing is a missing value, so a NOT NULL (or primary key) constraint rejects it, and a real SAS NOT NULL constraint on the target table rejects it too.|
|MINVAL|Fails - a special missing sorts below every number, so it is below any minimum.| |MINVAL|Passes. A missing value is not a number, so a minimum does not apply to it - use NOTNULL if the column must be populated. A real number below the minimum still fails.|
|MAXVAL|Passes - but the rule is then pointless: a special missing is below every maximum, so the missings pass and the column's real numbers fail.| |MAXVAL|Passes, for the same reason. A real number above the maximum still fails.|
|CASE|Not applicable - it is a character rule.| |CASE|Not applicable - it is a character rule.|
|ROUND|Ignored - ROUND only rounds values that are numbers, so a special missing is left as typed.| |ROUND|Ignored - ROUND only rounds values that are numbers, so a special missing is left as typed.|
|HARDREGEX / SOFTREGEX|Checked against the pattern like any other value. Unlike blanks and the plain `.`, special missings are **not** exempt. See [Regex Rules](#regex-rules).| |HARDREGEX / SOFTREGEX|Checked against the pattern like any other value. Unlike blanks and the plain `.`, special missings are **not** exempt. See [Regex Rules](#regex-rules).|
@@ -65,11 +65,11 @@ The rules treat a special missing as a value for some checks and as a missing va
|HARDSELECT|Supports special missings - the value is matched against the dropdown list like any other value.| |HARDSELECT|Supports special missings - the value is matched against the dropdown list like any other value.|
|HARDFORMULA / SOFTFORMULA|The formula returns `#VALUE!` for that row instead of a number, and that is what gets submitted.| |HARDFORMULA / SOFTFORMULA|The formula returns `#VALUE!` for that row instead of a number, and that is what gets submitted.|
In short, a special missing is **not supported** in a column that carries NOTNULL, MINVAL, MAXVAL or a formula. It is fine alongside the regex rules, the dropdowns, and ROUND. In short, a special missing is rejected by NOTNULL (and by a primary key column), and a formula returns `#VALUE!` for it. It is fine in a column that carries a range rule, a regex, a dropdown, or ROUND.
A primary key column is treated as NOT NULL whether or not the target table carries a physical constraint, and whether or not MPE_VALIDATIONS has a NOTNULL rule for it - a key identifies the row, so a blank and a special missing are both rejected there. A primary key column is treated as NOT NULL whether or not the target table carries a physical constraint, and whether or not MPE_VALIDATIONS has a NOTNULL rule for it - a key identifies the row, so a blank and a special missing are both rejected there.
One related gotcha: a range rule's own value must be a number. Put a special missing in `MINVAL` and every cell in the column fails; put one in `MAXVAL` and every real number fails. One related gotcha: a range rule's own value must be a number. The rule value is compared as a number, so a special missing there leaves nothing for a real value to pass: put one in `MINVAL` and every number in the column fails; put one in `MAXVAL` and every number fails too.
## Formula Rules ## Formula Rules