copylst.sas

来自「缺失数据的利器」· SAS 代码 · 共 25 行

SAS
25
字号
%macro copylst;
  %if (%sysfunc(filename(lstref, &path..lst)) eq 0) %then %do;
    %let file = %sysfunc(fopen(&lstref));
    %if (&file ne 0) %then %do;
      %let rc = %sysfunc(fclose(&file));
      %put Copy list.;
      data _null_;
        file print notitles linesize=133;
        infile "&path..lst" length=len end=test;
        do until (test eq 1);
          input line $varying133. len;
          if (substr(line, 1, 1) eq byte(12)) then do;
            len = len - 1;
            line = substr(line, 2, len);
            put _page_ line $varying133. len;
          end;
          else put line $varying133. len;
        end;
        output;
      run;
    %end;
  %end;
%mend copylst;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?