From: H S on 21 Mar 2010 18:04 Hi suppose I have a bunch of libraries called CARSALE CARBRAND CARWEIGHT In each library there is a file called COUNT How do I run a loop so that I can run proc means on each one of the libraries imaginary code: array list(3) list1 list2 list3 ('carsale','carbrand','carweight'); for i 1 to dim(list); do; proc means data=list(i).count; /*In reality I want proc means data=carsale.count data=carbrand.count data=carweight.count */ end; Thank you.
From: billyk43 on 22 Mar 2010 11:37 Here's one possible way: data _null_; set sashelp.vlibnam; if substr(libname,1,3)="car"; n+1; call symput('lib'||left(n),libname); call symput('libcnt',trim(left(n))); run; %macro do_means; %do i=1 %to &libcnt; proc means data=&&lib&i...count; run; %end; %mend; %do_means; Hope that helps. Disclaimer: This has not been tested.... On Mar 21, 6:04 pm, H S <jin...(a)gmail.com> wrote: > Hi suppose I have a bunch of libraries called CARSALE CARBRAND > CARWEIGHT > In each library there is a file called COUNT > How do I run a loop so that I can run proc means on each one of the > libraries > > imaginary code: > array list(3) list1 list2 list3 ('carsale','carbrand','carweight'); > for i 1 to dim(list); > do; > proc means data=list(i).count; /*In reality I want proc means > data=carsale.count data=carbrand.count data=carweight.count */ > end; > > Thank you.
|
Pages: 1 Prev: unistats powerpoint show Next: What is the right statistical procedure? |