From ac48b91bf413490aa73a407bc8c45459576e55af Mon Sep 17 00:00:00 2001 From: dc Date: Wed, 21 Oct 2026 08:14:55 +0000 Subject: [PATCH] docs(config): optional VAR_LABEL --- docs/derived-variables.md | 5 ++++- docs/tables/mpe_derived.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/derived-variables.md b/docs/derived-variables.md index 5e91ab5..a16bea8 100644 --- a/docs/derived-variables.md +++ b/docs/derived-variables.md @@ -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_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 `$.` and numeric variables to `.`; 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. diff --git a/docs/tables/mpe_derived.md b/docs/tables/mpe_derived.md index 0d25f83..25faec4 100644 --- a/docs/tables/mpe_derived.md +++ b/docs/tables/mpe_derived.md @@ -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_LOGIC char(4000)`: The SAS expression that produces the value - `ACTIVE num`: Set to 1 to apply the variable