From fff3a4939d1b58366cfa7dd2752d98ea913a61bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Bj=C3=A4rkefur?= Date: Wed, 11 Oct 2023 04:53:03 -0400 Subject: [PATCH] iesave : loop over each idvar for missing : issue #347 --- src/ado_files/iesave.ado | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ado_files/iesave.ado b/src/ado_files/iesave.ado index fec975d1..1286a02e 100644 --- a/src/ado_files/iesave.ado +++ b/src/ado_files/iesave.ado @@ -159,14 +159,16 @@ qui { capture isid `idvars' if _rc { - *Test if there is missing values in the idvars - capture assert !missing(`idvars') - if _rc { - count if missing(`idvars') - noi di as error "{phang}The ID variable(s) `idvars' have missing values in `r(N)' observation(s). The ID variable(s) need to be fully identifying, meaning that missing values (., .a, .b ... .z) or the empty string are not allowed.{p_end}" - noi list `idvars' if missing(`idvars') - noi di "" - } + foreach idvar of local idvars { + *Test if there is missing values in the idvars + capture assert !missing(`idvar') + if _rc { + count if missing(`idvar') + noi di as error "{phang}The ID variable(s) `idvar' have missing values in `r(N)' observation(s). The ID variable(s) need to be fully identifying, meaning that missing values (., .a, .b ... .z) or the empty string are not allowed.{p_end}" + noi list `idvars' if missing(`idvar') + noi di "" + } + } *Test if there are duplciates in the idvars tempvar iedup