その他に、SASHELP.VTABLEを通してファイルの存在チェックをしているものなど、SASログには現れない入力があります。
- /*
- *++
- * import io log-file
- *--
- */
- data iods;
- infile "c:\temp\iods.csv" dsd firstobs=2;
- attrib RW length=$1;
- attrib FILENAME length=$64;
- attrib DSN length=$32;
- attrib FNR length=8;
- attrib LOG length=$61;
- attrib NR length=8;
- input rw filename dsn fnr log nr;
- run;
- /*
- *++
- * input data-set
- *--
- */
- proc sort data=iods out=ids;
- by filename nr rw;
- run;
- data ids;
- set ids;
- by filename nr rw;
- if first.filename and rw eq 'R' then output;
- run;
- proc sort data=ids;
- by nr;
- run;
- /*
- *++
- * output data-set
- *--
- */
- proc sort data=iods out=ods;
- where rw eq 'W';
- by filename nr;
- run;
- data ods;
- set ods;
- by filename nr;
- if last.filename then output;
- run;
- proc sort data=ods;
- by nr;
- run;
- /*
- *++
- * make compare procedure statement
- *--
- */
- data _null_;
- set ods;
- attrib comment length=$256;
- attrib libstat length=$256;
- attrib titstat length=$256;
- attrib comproc length=$256;
- attrib mem length=$32;
- basedir = "/sumdata/bk02";
- comment = "/* dsn=" || compress(upcase(dsn)) || " logfile=" || compress(log) || " line=" || compress(put(fnr, best.)) || " */";
- put comment;
- i = 1;
- imax = length(filename);
- pos = 0;
- do i=1 to imax;
- if substr(filename, i, 1) eq '/' then pos = i;
- end;
- put "options nocenter;";
- libstat = "libname tmp1 '" || compress(basedir) || substr(filename, 1, pos-1) || "' access=readonly;";
- put libstat;
- libstat = "libname tmp2 '" || substr(filename, 1, pos-1) || "' access=readonly;";
- put libstat;
- titstat = "title 'dsn=" || compress(upcase(dsn)) || " log=" || compress(log) || "';";
- put titstat;
- mem = substr(dsn, index(dsn, ".")+1);
- comproc = "proc compare base=tmp1." || compress(mem) || " compare=tmp2." || compress(mem) || " maxprint=5;";
- put comproc;
- put "run;";
- put "title;";
- put ;
- run;
0 件のコメント :
コメントを投稿