%macro multiopen(startcomp,stopcomp);/* startcomp,stopcomp 參數 控制 從... 到*/

// %do comp=2330 %to 2331; //exper

%do comp=&startcomp %to &stopcomp;/*起始值與結束值, */

      %let K1= "D:\ &comp 專利權.xlsx"  ;  // 不加空白 & 的動作 不對

        %let KKKK=%sysfunc(compress(&K1)  );  //有空白 無法開檔, use compress remove space

       PROC IMPORT OUT= WORK.kk 

            DATAFILE= &KKKK

            DBMS=EXCEL REPLACE;

       RANGE="PatentData$" ; 

       GETNAMES=YES;

       run;

     %end;

%mend multiopen;

 

%multrep(1216,1222) ; /* call macro  7 data set read from excel */

arrow
arrow
    文章標籤
    SAS MACRO programming
    全站熱搜

    cianfen 發表在 痞客邦 留言(0) 人氣()