Hello, How to retrieve the macro variable value for each observation (or particular observation) using %SYSCALL SET() as compared to CALL SYMPUTX() where we can get macro variable value for specific observations (such as 1 anf 19 in exmaple below). %let dsid=%sysfunc(open(sashelp.class,i));
%syscall set(dsid);
%let rc=%sysfunc(fetchobs(&dsid,1));
%let rc=%sysfunc(close(&dsid));
%put _user_;
%put name = &name age = &age sex = &sex;
data _null_;
set sashelp.class;
call symputx("macvar_name"||put(_n_,best. -l), name);
call symputx("macvar_age"||put(_n_,best. -l), age);
call symputx("macvar_sex"||put(_n_,best. -l), sex);
run;
%put name = &macvar_name1 age = &macvar_age1 sex = &macvar_sex1;
%put name = &macvar_name19 age = &macvar_age19 sex = &macvar_sex19;
... View more