Date: Thu, 23 Oct 2003 15:14:44 +0200
Reply-To: Andre Wielki <wielki@INED.FR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Andre Wielki <wielki@INED.FR>
Subject: Fwd: Re: SASTip77 - Automatic checking of the LOG
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
>Philip Mason has proponed a usefull thing
>
>At 23:03 20/10/2003 +0100, Phil Mason wrote:
>>Daily Tip 77 20/10/2003 5:29 PM
>>
>>Automatic checking of the LOG
>
>Here is a enriched version of his tip WITH colors distinguising between
>errors and warnings
>
>%macro log;
>filename cat catalog 'work.test.test.log' ;
>dm 'log;file cat';
>ods listing close ;
>proc template;
>define table warnerr;
> column _n_ line;
> dynamic colheader;
> define _n_;
> generic=on;
> header=colheader;
>end;
>define line;
> header="Line from Log";
> cellstyle substr(_val_,1,5)='ERROR' as {foreground=#cc0066
> background=#ffffff},
> 1 as {foreground=#0066ff background=#ffffff};
> end;
>end;
>run;
>ods html file='analyse.htm' ;
>data analyse ;
> length line $ 200;
> *label line='Line from LOG'
> _n_='Line number' ;
> infile cat end=end truncover ;
> file print ods=(template="warnerr"
> columns=(_n_=_n_(generic=on
> dynamic=(colheader='n°line')) line=line)
> );
> * vars=(_n_ line)) ;
> input line & ;
> if substr(line,1,5)='ERROR' or substr(line,1,7)='WARNING' then
> put _ods_ ;
> else
> n+1 ;
> if end & n=_n_ then
> do ;
> window status rows=15 columns=40 color=gray
> #5 'No errors or warnings were found.' color=yellow
> #9 'Press enter to continue' ;
> display status ;
> end ;
>run ;
>ods html close ;
>filename cat ; * free catalog member ;
>dm 'del work.test.test.log' results viewer ; * delete it & show HTML ;
>ods listing ;
>******=======> which code to close program editor and return to enhanced
>editor?;
>%mend;
>%log
>;
>
>
>It could be usefull if anybody has the solution
>for the return to the ENHANCED editor in place of program editor
>after applying it by a sas tool button.
>
>Andre
>
___________
WIELKI Andre
INED - Service Informatique
133 Bd Davout,
75 980 Paris Cedex 20
FRANCE
Tel: 01 56 06 21 54
|