The goal was to set up if statements that compare a string to a state code
if st .eq. "NJ"
did not work as I expected
So I tried if %strcmp(_) but it always evaluates to 0
I am most puzzled that the following code produces 0's
Code: Select all
compute [string] st= "NJ"
compute [string] stnj= "NJ"
display "State : " st stnj %strcmp(st,stnj) %strcmp(%left(st,2),%left(stnj,2)) %strcmp("A","A") %strcmpnc(st,stnj) %strcmpnc("A","A")