# DSL unset statements

You can clear a map key by assigning the empty string as its value: `$x=""` or `@x=""`. Using `unset` you can remove the key entirely. Examples:

GENMD-RUN-COMMAND
cat data/small
GENMD-EOF

GENMD-RUN-COMMAND
mlr put 'unset $x, $a' data/small
GENMD-EOF

This can also be done, of course, using `mlr cut -x`. You can also clear out-of-stream or local variables, at the base name level, or at an indexed sublevel:

GENMD-RUN-COMMAND
mlr put -q '@sum[$a][$b] += $x; end { dump; unset @sum; dump }' data/small
GENMD-EOF

GENMD-RUN-COMMAND
mlr put -q '@sum[$a][$b] += $x; end { dump; unset @sum["eks"]; dump }' data/small
GENMD-EOF

If you use `unset all` (or `unset @*` which is synonymous), that will unset all out-of-stream variables which have been assigned up to that point.
