worldbank/iefieldkit

ieduplicates : error when two vars only differ in case

Opened this issue · 0 comments

foreach var of local existingExcelVarsRaw {
local lowcase = lower("`var'")
if ("`var'"!="`lowcase'") rename `var' `lowcase' // Will throw error if name is the same
}

Error happens if these two conditions are satisfied:

  1. The dataset has two vars that will have the same name if both converted to lower case (examples region/REGION, region/Region or rEgion/reGion )
  2. Both are included in ID_varname, uniquevars() or keepvars() OR one var is lower case (region) not included in the command but the var is included in ID_varname, uniquevars() or keepvars() .

For a reason I do not remember, the command change all variables in the report to lower case.

Two options to be investigated to solve this.

  1. Test if this is the case and provide user with a helpful error message
  2. See if the command can be modified so it can handle these cases without error.