loops - SPSS Looping across multiple string variables to find duplicates -
i have long list of records text names in 2 columns, x1 , x2. want compare x2 names x1 names , identify match instance of x1 , note in temp variable. i've tried looping through 2 columns (see syntax below) "y" @ every record.
i hope can show me correct syntax.
thanks
bren
string temp(a1). compute temp= "n". vector x=x1 x2. loop #i=1 77700. loop #j = (#i+1) 77700. if x(#i)=x(#j) temp = "y". end loop. end loop. execute.
i believe solved problem.
compute index=$casenum. sort cases name1. string key (a63). compute main=name2. aggregate outfile * / break name1 / found=n. rename variables name1=main. match files file index / table * /in=match / main . sort cases index.
thanks viewed , thinking problem me.
Comments
Post a Comment