Skip to content

Commit

Permalink
iesave : loop over each idvar for missing : issue #347
Browse files Browse the repository at this point in the history
  • Loading branch information
kbjarkefur committed Oct 11, 2023
1 parent 6d45e69 commit fff3a49
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/ado_files/iesave.ado
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fff3a49

Please sign in to comment.