I'm working on a program where I have a series of countries where each country has two variables that I want to create an identity out of. I'd also like to write the program so it returns "NA" if the identity equals one of the values (I know that some of the countries are missing the second piece of data). What I coded is below, but it's not quite working out. I'm wondering anyone has some suggestions.
Code: Select all
for %i USA AFG ALB ALG ANG AGL ANT ARG ARM ARU AUST ASTR AZE BAHA BHR BAN BAR BYE BEL BELI BEN CAN COL COM CON ZAI FIN FRA
smpl @all
series {%i}_A_B = na
smpl if {%i}_A_B = na
genr {%i}_A_B = {%i}_A - {%i}_B
if {%i}_A_B ={%i}_A then
{%i}_A_B= NA
endif
next
