take unique number of student in the input dataset, proc sort data=stdudata out=tstdup nodupkey; by studentname; run; data _null_; set tstdup end=f; call symput("ST"||strip(put(_n_,3.)), strip(studentname)); if f then call symput("nof",strip(put(_n_,3.))); run; %macro student; %do h= 1 %to &nof; data student_&h; SET class; where upcase(studentname)=upcase("&&st&h"); Run; proc print data = student_&h; rUN; %end; %mend student; %student; This program will print all the student, u dont want to call individual student by their name, it will take unique value from the input dataset and then print for all the students. If you have any questions, let me know
... View more