Date: Tue, 11 May 2004 09:46:59 -0500
Reply-To: GSnell@DataSavantConsulting.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gregg Snell <gsnell@DATASAVANTCONSULTING.COM>
Organization: Data Savant Consulting
Subject: Re: how to clear up log automatically
In-Reply-To: <54E64641BDABD711AAB90002A546927C02490BAB@S-CHO-EXCH0006>
Content-Type: text/plain; charset="us-ascii"
I would second Gary's comment about checking your log for errors before
clearing it and Richard's example below is a good start. Below is a
snippet of code I have used in the past to read a log file and lift out
any errors. I thought you might find it useful.
/* read full log into work.log, any errors into work.errors */
data log(keep=logline) errors;
infile logfile missover;
length logline $256 code macroname $20;
retain code macroname;
input;
if index(_infile_,'0D'x) then logline=scan(_infile_,1,'0D'x);
else logline=_infile_;
logline = translate(logline,' ','%');
if index(logline,'MPRINT(') then macroname=scan(logline,2,'()');
if index(logline,':') then code=scan(logline,1,':');
else if substr(logline,1,5) ne ' ' then code=scan(logline,1,' ');
output log;
if index(code,'ERROR') =1 and logline ne ' ' then output errors;
run;
Regards,
Gregg P. Snell
Data Savant Consulting
(913) 638-4640
(208) 977-1943 efax
GSnell@DataSavantConsulting.com
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
(Richard Simhon)
Sent: Tuesday, May 11, 2004 9:29 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: how to clear up log automatically
If the log window fills up and prevents your program from completing
then why not send the log out to a file. At least there you will be able
to check it and make sure that no errors have occurred or warning
messages issued which would otherwise be missed if the log was
automatically cleared
use:
filename templog "F:\dir\log_result.txt";
proc printto log templog;
"your program code"
proc printto log = log;
run;
Hope this helps!
Richard Simhon
Business Analyst
Personal Lines
Allianz Cornhill
Tel: +44 (0) 1483 552628
Fax: +44 (0) 1483 552424
Email: Richard.Simhon@allianzcornhill.co.uk
> -----Original Message-----
> From: Gary Ross [SMTP:gary_ross@MGIC.COM]
> Sent: 11 05 2004 2:39 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: how to clear up log automatically
>
> Zhonghe Li wrote:
> >
> > Hi everyone,
> >
> > What system option to use to clear up the log automatically when it
> > is full? Thank you.
> >
> > Elena
>
> I would be much more interested (if it was my log) "why" the log is
> full than how to automatically clear the log. A full log indicates
> other program problems or bugs which once cleared up, prevent full
> logs. IMHO
************************************************************
Copyright in this message and any attachments remains
with us. It is confidential and may be legally privileged.
If this message is not intended for you it must not be read, copied or
used by you or disclosed to anyone else. Please advise the sender
immediately if you have received this message in error.
Although this message and any attachments are believed
to be free of any virus or other defect that might affect
any computer system into which it is received and opened
it is the responsibility of the recipient to ensure that
it is virus free and no responsibility is accepted by
Allianz Cornhill Insurance plc for any loss or damage in
any way arising from its use.
Cornhill Life, Cornhill Direct and Allianz Global Risks
are trading names of Allianz Cornhill Insurance plc.
Petplan and DBI are part of the Allianz Cornhill group of companies.
Allianz Cornhill Insurance plc, Registered in England
number 84638. Registered Office: 57 Ladymead, Guildford,
Surrey GU1 1DB.
Allianz Cornhill Insurance plc is authorised and regulated
by the Financial Services Authority.
Member of the General Insurance Standards Council for
general insurance business.
************************************************************