From bbd5793d8bc5a15c5df19d6b3b21f3742d2f957c Mon Sep 17 00:00:00 2001 From: dc Date: Wed, 23 Sep 2026 21:01:16 +0000 Subject: [PATCH] fix(blog): the period is optional, and a range rule ignores a missing Three corrections to the special missings post: - a special missing is typed with or without its leading period - `.a` and `a` are the same missing - MINVAL and MAXVAL both accept a special missing, 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 - the formula rules are the one case where a special missing genuinely does not work, so the range rules are no longer grouped with them --- content/feed/sas-special-missings/index.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/content/feed/sas-special-missings/index.md b/content/feed/sas-special-missings/index.md index 16a6450..b302f2c 100644 --- a/content/feed/sas-special-missings/index.md +++ b/content/feed/sas-special-missings/index.md @@ -26,7 +26,7 @@ They exist because "missing" is usually not the whole story. A survey question t A display gotcha worth knowing: a regular missing prints as `.`, unless `options MISSING=` changes that character - set it to blank and a regular missing renders as an empty cell. The option affects only the regular missing; `._` and `.A`-`.Z` always print as their own letter. So a blank cell in a SAS listing is still unambiguously a regular missing, and a lone letter is still a special one. Data Controller itself is unaffected either way - it sends a regular missing to the browser as `null` and a special missing as its letter. -In a SAS dataset they are written with a leading period (`.A`, `.B` ... `._`). In Data Controller you type just the letter or the underscore - no period - and the letter is not case sensitive. Two letters, or a letter mixed with a number, are refused rather than guessed. +In a SAS dataset they are written with a leading period (`.A`, `.B` ... `._`). In Data Controller you type the letter or the underscore, with or without that period - `.a` and `a` are the same missing - and the letter is not case sensitive. Two letters, or a letter mixed with a number, are refused rather than guessed. There is one cell where the letter cannot be typed at all. A numeric column that carries a date, datetime or time format is edited through a date picker rather than the numeric editor, and a picker accepts only a date. @@ -53,9 +53,13 @@ These are Data Controller's own rules, configured per column in the `MPE_VALIDAT - `SOFTSELECT` / `HARDSELECT` - both support special missings; a soft dropdown never blocks a value, and a hard one lists them alongside the ordinary values - `ROUND` - harmless. It only rounds values that are numbers, so a special missing is left exactly as it was typed -Special missings are **not supported** in a column that carries a range rule or a formula: +The range rules step aside for a missing value, because a missing is not a number for a minimum or a maximum to apply to: + +- `MINVAL` / `MAXVAL` - both accept a special missing, and both still reject a real number that is out of range. Use `NOTNULL` if the column has to be populated; a range rule alone leaves the column free to hold a missing +- The rule's own value has to be a number: put a special missing in `MINVAL` and every real number in the column fails, and the same in `MAXVAL` - a rule value that is not a number leaves nothing for a value to pass + +A formula is the one case where a special missing genuinely does not work: -- `MINVAL` / `MAXVAL` - a special missing sorts below every number, so `MINVAL` rejects it and `MAXVAL` accepts it while rejecting the column's real numbers. The rule's own value has to be a number too: put a special missing in `MINVAL` and every cell in the column fails, put one in `MAXVAL` and every real number fails - `HARDFORMULA` / `SOFTFORMULA` - a formula that reads a special-missing cell does not compute; the grid's spreadsheet engine returns `#VALUE!` for that row, where the plain `.` contributes 0 `CASE` (`UPCASE` / `LOWCASE`) is a character rule and does not come into it: SAS hands the browser a special missing as an uppercase letter, so there is no case to enforce, and a `CASE` rule on a numeric column would reject the column's numbers rather than the missing. @@ -91,7 +95,7 @@ We solved that in the open source SASjs Adapter, and it has been in Data Control - the adapter infers the column type from the values, so a column of numbers that also holds a lone letter is written to SAS as numeric, with the letter as a special missing - where the type cannot be inferred - a numeric column holding ONLY special missings - Data Controller passes the column format explicitly -- you type the letter on its own: a or A, no period, and case does not matter +- you type the letter or the underscore, with or without the period: a, .a, _, ._, and case does not matter - one exception: a date, datetime or time formatted numeric column edits through a date picker, which takes only a date How they behave in Data Controller's validation rules: @@ -102,9 +106,9 @@ How they behave in Data Controller's validation rules: - SOFTSELECT and HARDSELECT both support them - ROUND leaves it alone, because it only rounds numbers -Special missings are not supported where a range rule or a formula is configured: +The range rules step aside for one - a missing is not a number for a minimum or a maximum to apply to: -- MINVAL rejects it; MAXVAL accepts it but rejects the column's real numbers +- MINVAL and MAXVAL both accept it, and both still reject a real number that is out of range; use NOTNULL if the column must be populated - a HARDFORMULA/SOFTFORMULA that reads a special-missing cell returns #VALUE! rather than a number In short: a value for the pattern and dropdown rules, a missing value for anything that wants a number.