docs(config): derived variables in the EDIT screen #21

Merged
allan merged 23 commits from docs/derived-variables into main 2026-10-21 22:26:31 +00:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit ac48b91bf4 - Show all commits

No files matched your search

+4 -1
View File
@@ -24,6 +24,7 @@ Each row defines one variable:
- `VAR_TYPE` - `C` for character, `N` for numeric
- `VAR_LEN` - character length, or numeric length (1-8)
- `VAR_FMT` - optional, eg `DATE9.` or `DOLLAR12.2`
- `VAR_LABEL` - optional; when blank the label is `<VAR_NM>=<expression>`
- `VAR_LOGIC` - the SAS expression that produces the value
- `ACTIVE` - set to 1 to apply the variable
@@ -35,6 +36,7 @@ VAR_DEPS STATE
VAR_TYPE C
VAR_LEN 8
VAR_FMT (blank)
VAR_LABEL (blank)
VAR_LOGIC ifc(STATE in ('CA','OR','WA'),'West','East')
ACTIVE 1
```
@@ -47,6 +49,7 @@ VAR_DEPS REGION STATE
VAR_TYPE C
VAR_LEN 14
VAR_FMT (blank)
VAR_LABEL Region and state
VAR_LOGIC cats(REGION,'-',STATE)
ACTIVE 1
```
@@ -60,7 +63,7 @@ attrib REGION length=$8 label='REGION=ifc(STATE in (''CA'',''OR'',''WA''),''West
REGION = ifc(STATE in ('CA','OR','WA'),'West','East');
```
The label is the variable name, an equals sign and the expression - `REGION=ifc(...)` - so the column shows both what it is and where it comes from when labels are switched on. The expression is truncated to the maximum label length.
The label is `VAR_LABEL` when one is supplied, otherwise the variable name, an equals sign and the expression - `REGION=ifc(...)` - so the column shows both what it is and where it comes from when labels are switched on. Either way the label is truncated to the maximum label length, on a boundary that cannot split a doubled quote.
The type and length are declared, not inferred, so a value is truncated exactly as you specify. If `VAR_FMT` is left blank, character variables default to `$<length>.` and numeric variables to `<length>.`; a date, time or datetime format makes the column render (and filter) as a date, time or datetime, the same way a stored column does.
+1
View File
@@ -21,5 +21,6 @@ The table is itself registered in [MPE_TABLES](/tables/mpe_tables/), so it is ma
- `VAR_TYPE char(1)`: `C` for character, `N` for numeric
- `VAR_LEN num`: Character length, or numeric length (1-8)
- `VAR_FMT char(32)`: Optional SAS format, eg `DATE9.`
- `VAR_LABEL char(256)`: Optional label; defaults to `<VAR_NM>=<expression>`
- `VAR_LOGIC char(4000)`: The SAS expression that produces the value
- `ACTIVE num`: Set to 1 to apply the variable