Function for SAS similarity
function simi_sas ( s1 , s2 , a1 , a2 ) { a1 . sort ( function ( a , b ) { return a - b } ) ; a2 . sort ( function ( a , b ) { return a - b } ) ; s1 . sort ( function ( a , b ) { return a - b } ) ; s2 . sort ( function ( a , b ) { return a - b } ) ;