DATA Step, Macro, Functions and more

Macro's

Reply
N/A
Posts: 0

Macro's

1.I have 10 datasets i want to sort all datasets at a time by using single Proc sort procedure in macro's?
Contributor
Posts: 44

Re: Macro's

Rename your datasets all with the same prefix, like DS1, DS2...DS10.

%macro sortit;

%do i = 1 to 10;
proc sort data=ds&i;
by var1 var2...;
run;
%end;
%mend

%sortit;
Ask a Question
Discussion stats
  • 1 reply
  • 118 views
  • 0 likes
  • 2 in conversation