Returns the number of a variable's position in a SAS data set.
Category: | SAS File I/O |
/* Tested 2/27/98 — OK */ %INCLUDE '/local/u/lirezn/sasuser/assist.src';
data vars; length name $ 8 type $ 1 format informat $ 10 label $ 40; drop dsid i num rc; dsid=open("sasuser.houses","i"); num=attrn(dsid,"nvars"); do i=1 to num; name=varname(dsid,i); type=vartype(dsid,i); format=varfmt(dsid,i); informat=varinfmt(dsid,i); label=varlabel(dsid,i); length=varlen(dsid,i); position=varnum(dsid,name); output; end; rc=close(dsid); run;