Loading...
Searching...
No Matches
mpe_derived_postedit.sas File Reference

Post Edit Hook script for the MPE_DERIVED table. More...

Go to the source code of this file.

Detailed Description

Post edit hooks provide additional backend validation for user provided data. The incoming dataset is named work.staging_ds and is provided in mpe_loader.sas.

Available macro variables:

  • DC_LIBREF - The DC control library
  • LIBREF - The library of the dataset being edited (is assigned)
  • DS - The dataset being edited

This hook normalises the incoming rows and applies the configuration rules at submit time, so a bad derived variable is rejected while the submitter is still watching - rather than breaking the EDIT screen later, when the view is built.

VAR_DEPS must list every input the expression uses, physical columns and derived variables alike. The hook checks the part that does not need the target library: a derived variable referenced by an expression must be declared, a variable may not depend on itself, and the resulting graph must be acyclic - across the incoming rows and the current rows they do not replace.

The target table is not assigned in this context, so the collision between VAR_NM and a physical column, and the resolution of a physical dependency, are left to mpe_derived, which runs with the target library assigned. Uniqueness on the business key (LIBREF DSN VAR_NM) is checked by mpe_loader before this hook runs, but on the raw submitted values, so it is case sensitive: 'Region' and 'REGION' for the same table both pass the loader and collide only at approve time. The post-normalisation check below rejects the second one at submit time, naming the variable.

SAS Macros

Related Macros

Author
4GL Apps Ltd

Definition in file mpe_derived_postedit.sas.