Dear all,

I am having troubles with some macros. My peace of code is

Code:
foreach ETC in $ETC{

     preserve

    keep if ETC=="`ETC'"
    
    if etc[1] == "Bogotá"{
        local Nombre = "Bogotá, D.C"
    }
    if etc[1] == "Guajira"{
        local Nombre = "la Guajira"
    }
    if etc[1] == "Nortesantander"{
        local Nombre = "Norte de Santander"
    }
    if etc[1] == "SanAndres"{
        local Nombre = "San Andrés"
    }
    if etc[1] == "SantaMarta"{
        local Nombre = "Santa Marta"
    }
    if etc[1] == "Valle"{
        local Nombre == "Valle del Cauca"
    }
    else{
        local Nombre = ETC in 1
    }
    restore

    file write `ETC' `"\newpage"' _n

    file write `ETC' `"\section{Resultados de `Nombre'}"' _n

    file write `ETC' `"\subsection{Ambiente escolar en `Nombre'}"' _n
}
I have as global named "ETC" and I am writing a document for each one of the categories included in that global. Since, some of the names of each one of the ETC are several-words-names, I had to create certain conditionals for those cases and change the local to be used to include the corresponding name in the document. However it seems to not work when writting the section title (as shown above) and it works later on in the document (for example, when `ETC' == "Bogotá" the code indeed writes "Bogotá, D.C" in the body of the document, the only section where it does not work is in the peace of code stated above). Does anyone know why this might be?

Thank you in advance.