Links SAS data set variables to DATA step or macro variables that have the same name and data type.
| Category: | Variable Control |
%macro setvar;
%let dsid=%sysfunc(open(sasuser.houses,i));
/* No leading ampersand with %SYSCALL */
%syscall set(dsid);
%let rc=%sysfunc(fetchobs(&dsid,10));
%let rc=%sysfunc(close(&dsid));
%mend setvar;
%global price style;
%setvar
%put _global_;data mydata;
/* create variables for assignment */
/*by CALL SET */
length style $8 sqfeet bedrooms baths 8
street $16 price 8;
drop rc dsid;
dsid=open("sasuser.houses","i");
call set (dsid);
do i=1 to 10;
rc=fetchobs(dsid,i);
output;
end;
run;