SASデータセット内の変数の位置番号を返します。
カテゴリ: | SASファイルI/O |
%let dsid=%sysfunc(open(city, i)); %let citynum=%sysfunc(varnum(&dsid, CITYNAME)); %let rc=%sysfunc(fetch(&dsid)); %let cityname=%sysfunc(getvarc (&dsid, &citynum));
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;