From 4d53ced89c1e7f872e9d8b50bb5404cfef455a09 Mon Sep 17 00:00:00 2001 From: dc Date: Wed, 23 Sep 2026 07:50:06 +0000 Subject: [PATCH] docs(validations): document how each rule treats a special missing value New Special Missing Values section covering NOTNULL, MINVAL/MAXVAL, CASE, ROUND, the regex rules, the dropdowns and the formula rules, with the 'not supported' set called out. Behaviour verified against a real SAS estate and the deployed frontend validator. --- docs/dcc-validations.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/dcc-validations.md b/docs/dcc-validations.md index 9f7977d..d1bb4f1 100644 --- a/docs/dcc-validations.md +++ b/docs/dcc-validations.md @@ -23,12 +23,12 @@ It is possible to configure a number of other rules by updating the MPE_VALIDATI ## Configurable Checks -Check back frequently as we keep growing this list of checks. +Check back frequently as we keep growing this list of checks. For how each rule treats a special missing value (`.A`-`.Z`, `._`), see [Special Missing Values](#special-missing-values). |Rule Type|Example Value |Description| |---|---|---| |CASE|UPCASE|Will enforce the case of cell values. Valid values: UPCASE, LOWCASE, PROPCASE| -|NOTNULL|(defaultval)|Will prevent submission if null values are present. Optional - provide a default value.| +|NOTNULL|(defaultval)|Will prevent submission if null values are present - a special missing counts as null. Optional - provide a default value.| |MINVAL|1|Defines a minimum value for a numeric cell| |MAXVAL|1000000|Defines a maximum value for a numeric cell| |READONLY|(defaultval) |Renders the column read-only in the editor. The defaultval is used when rows are added. | @@ -45,6 +45,28 @@ Check back frequently as we keep growing this list of checks. |[SOFTSELECT_HOOK](/dynamic-cell-dropdown)|/physical/path/program.sas|A SAS service (STP or Viya Job) or a path to a SAS program on the filesystem. User-provided values may (or may not) be in this list. Cannot be used alongside a HARDSELECT_HOOK.| +## 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. + +The rules treat a special missing as a value for some checks and as a missing value for others: + +|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.| +|MINVAL|Fails - a special missing sorts below every number, so it is below any minimum.| +|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.| +|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.| +|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).| +|SOFTSELECT|Passes - a soft dropdown never blocks a value.| +|HARDSELECT|Fails - the strict membership test cannot match it (the dropdown list for a numeric column holds numbers).| +|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, HARDSELECT or a formula. It is fine alongside the regex rules, a soft dropdown, and ROUND. + +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. + ## Formula Rules HARDFORMULA and SOFTFORMULA let you configure a column so that its value is automatically calculated from other columns in the same row - just like a spreadsheet formula. When a user opens the editor, the formula is evaluated live and the result is shown in each cell.