あなたのフォルダ構造についてもっと知らなければ、私は問題の最初の部分についてコメントすることはできません。ログファイルの名前がわかったら、次のようなものを使用できます。
次のコードは2つのデータセットを作成します。1つ目は完全なログで、ログの1行に1つの観測値があります。2番目のデータセットには、「ERRORS」として識別された行のみが含まれています。コードのタイプミスやその他の構文またはセマンティックの問題を隠す可能性があるため、特定の警告とメモステートメントをエラーと見なしていることに注意してください。
%let logfile = myfile.log;
**
** READ IN LOGFILE. CHECK FOR PROBLEMS
*;
data problems log;
length line $1000;
infile "&logfile";
input;
logfile = "&logfile";
line_no = _n_;
line = _infile_;
problem = 0;
if
(
line =: "ERROR:"
or line =: "WARNING:"
or line =: "NOTE: Numeric values have been converted to character values"
or line =: "NOTE: Character values have been converted to numeric values"
or line =: "NOTE: Missing values were generated as a result of performing an operation on missing values"
or line =: "NOTE: MERGE statement has more than one data set with repeats of BY values"
or line =: "NOTE: Invalid (or missing) arguments to the INTNX function have caused the function to return"
or line =: "INFO: Character variables have defaulted to a length of 200"
or line =: "NOTE: Invalid"
)
and not
(
line =: "WARNING: Your system is scheduled to expire"
or line =: "WARNING: The Base Product product with which Session Manager is associated"
or line =: "WARNING: will be expiring soon, and is currently in warning mode to indicate"
or line =: "WARNING: this upcoming expiration. Please run PROC SETINIT to obtain more"
or line =: "WARNING: information on your warning period."
or line =: "WARNING: This CREATE TABLE statement recursively references the target table. A consequence"
or line =: "WARNING: Unable to copy SASUSER registry to WORK registry. Because of this, you will not see registry customizations during this"
or line =: "ERROR: A lock is not available for"
or line =: "ERROR: Errors printed on page"
)
then do;
problem = 1;
output problems;
end;
output log;
run;