/* LOC.G: procedure to find variable positions corresponding to a list of variable character mnemonics for a Gauss dataset John Rust, University of Wisconsin, February, 1990 Inputs: vnames: vector of names whose position numbers are to be returned dsnames: list of variable names from a Gauss dataset (getname) */ proc (1)=loc(vnames,dsnames); local i,r,vpos; r=rows(vnames); vpos=zeros(r,1); if r > 1; i=1; do until i > r; vpos[i]=maxindc(stof(lower(vnames[i])) .== stof(lower(dsnames))); if ((vpos[i] == 1) and (stof(lower(vnames[i])) ./= stof(lower(dsnames[1])))); /* "Error in LOC.G: no match for "$+vnames[i]; */ vpos[i]=-1; endif; i=i+1; endo; else; vpos=maxindc(stof(lower(vnames)) .== stof(lower(dsnames))); if ((vpos == 1) and (stof(lower(vnames)) ./= stof(lower(dsnames[1])))); /* "Error in LOC.G: no match for "$+vnames; */ vpos=-1; endif; endif; retp(vpos); endp;