Tips Allgemeines
Log auswerten
Q:
Is there a file or data set containing all of SAS's error, warnings and notes?
A:
The list:
1 0 OBS
2 AT LEAST
3 CARTESIAN SQL Coding.
4 CLOSING SCL - closing data set left open.
5 CONVERT For variable type conversions.
6 DIVISION BY ZERO
7 DUE TO LOOPING
8 END OF MACRO With MLOGIC OPTION in effect.
9 ENDING EXECUTION With MLOGIC OPTION in effect.
10 ERROR
11 ERRORABEND
12 ERRORCHECK=STRICT
13 EXCEED
14 HANGING
15 HAS 0 OBSERVATIONS
16 ILLEGAL
17 INCOMPLETE
18 INVALID
19 LOST CARD
20 MATHEMAT
21 MERGE STATEMENT
22 MISSING
23 MULTIPLE
24 NOT FOUND
25 NOT RESOLVED
26 OBS=0
27 REFERENCE
28 REPEAT As in "repeats" of by vars.
29 SAS CAMPUS DRIVE Batch jobs?
30 SAS SET OPTION OBS=0
31 SAS WENT
32 SHIFTED
33 STOP As in "stopped."
34 TOO SMALL
35 UNBALANCED
36 UNCLOSED
37 UNINITIALIZED
38 UNREF As in "unreferenced.'
39 UNRESOLVED
40 WARNING
I use the following code to read a SASlog but first I put the above list
in a SAS data set named mylib.logtxt. The strings are in uppercase.
/* Read each string value into a macro var. At the end of the data
set, create a macro var with the total count of strings. */
%macro series;
data _null_;
set mylib.logtxt end=eof;
call symput('string'||left(put(_n_,2.0)),trim(left(string)));
if (eof) then
call symput('cnt',put(_n_,2.0));
run;
/* Display all macro vars created - testing. */
%do I=1 %to &cnt;
%put &&string&I;
%end;
%mend series;
%series
/* This macro reads a SASlog (which is in an external file) for "key"
words. When a "key" word or string is discovered, it is added to a
second external file. (Unix environment.) */
filename logfile '$HOME/sas_log';
filename myfile '$HOME/sas_log2';
%let logfile=$HOME/sas_log2;
%macro strings;
data _null_;
length file $20 string $20;
retain x;
infile logfile length=lenline end=eof;
file myfile;
input @1 line $varying133. lenline @;
%do I=1 %to &cnt;
string="&&string&I";
found=index(upcase(line),trim(string));
if (found) then
do;
input;
x=1;
file="&logfile";
line=left(line);
put @1 file @23 line;
end;
%end;
if (eof) then
do;
if (x) then put // @10 '* * * End of SASlog * * *';
else put // @10
'* * * End of SASlog reached - no problems found. * * *';
end;
run;
%mend strings;
%strings;
Quick Reference im Web
Q:
Is there a referenceguide on the web?
A:
In the download area of the SI site
ts486.txt
is a fairly up-to-date quick ref to functions & formats
Although it is fairly limited to functions and formats, it still runs to
60k - it doesn't leave much hope for *any* reference card to be quick!
SAS neu initialisieren
Q:
How can I get back to normal after unbalanced quotes and similar?
A1:
There seems to be agreement that there is no simple 'reset' command.
A2:
*);*/;/*'*/ /*"*/; %mend;
A3:
gsub "*);*/;/*'*/ /*""*/; %mend;"
A4:
*))%*))'"*/;
;;;;
%mend;
options notes;
proc unk; run;
The proc unk;run; tests if the compiler is 'working'.
Copyright © 1998-2001 Eckhard Becker