|
Ya Huang,
The TERMINAL device-type is included in the SAS OnlineDoc for the FILENAME
statement.
Unlike the data step WINDOW statement, it works even after the SAS AWS has
been minimized.
A couple of potential drawbacks are that all text written to the terminal
window remains in the window for the entire SAS session, and the user must
close the window to terminate the SAS session.
RandyHerbison@westat.com
-----Original Message-----
From: Huang, Ya [mailto:ya.huang@pfizer.com]
Sent: Wednesday, May 22, 2002 5:37 PM
To: Randy Herbison; SAS-L@LISTSERV.UGA.EDU
Subject: RE: Generate a separate .... also for "Writing messages to
window s console"
Randy,
Cool! How did you find out this 'terminal' option? Is this another
undocumented feature? I tested your code, both interactive and batch
submission, and they both worked!! It was tested in Win2K/SAS v8.2.
This seems to be the best solution for the discussion
"Writing messages to windows console" in early of May.
filename userNote terminal;
data _null_;
file userNote;
do i=1 to 10;
a=sleep(2);
put 'Hello world!' i=;
end;
run;
filename userNote clear;
Thanks
Kind regards,
Ya Huang
-----Original Message-----
From: Randy Herbison [mailto:RandyHerbison@WESTAT.COM]
Sent: Wednesday, May 22, 2002 12:00 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Generate a separate window when SAS encounters a
pre-defined condition / error
David,
This works with Windows 98. I don't have access to Windows 2000 network to
try it.
filename userNote terminal;
data _null_;
file userNote;
put 'Hello world!';
run;
filename userNote clear;
RandyHerbison@westat.com
-----Original Message-----
From: David [mailto:david5705@HOTMAIL.COM]
Sent: Wednesday, May 22, 2002 2:22 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Generate a separate window when SAS encounters a
pre-defined condition / error
Dear Peter:
Thanks for your feedback.
SAS technical support told me that there is no way to generate a
window that will appear on the monitor once the SAS window has been
minimized (Windows 2000 network, SAS 8.02). They provided the
following code to generate a generic window (if the SAS window remains
open):
data test;
do i=1 to 10;
j=i+2;
output;
end;
run;
data _null_;
set test;
window one
rows=10 columns=20
#2 @1 'Error in data';
if i gt 8 then do;
display one;
abort;
end;
run;
data test;
set test;
run;
I also wanted to link a specific error code - using sysrc - to a
specific error. However, the best that can be done is to identify that
an error occurred.
Looks like I'll stick with writing the log to an external log file
using PROC PRINTTO and then follow the execution of the SAS session
from there.
Thanks again for your feedback,
David.
peter.crawford@DB.COM (Peter Crawford) wrote in message
news:<OF51CA07DD.BC9D0DF4-ON41256BBB.005731A6@db.com>...
> The data step has a window statement.
> Would that provide what you want ?
> It only stops processing if you require feedback.
> You could support it with conditional logic to
> continue processing
> change a data value
> stop the step
> stop sas
> whatever else you feel appropriate
> you just have to prepare !
>
> good luck
> Peter Crawford
>
>
>
>
>
> Datum: 13.05.2002 23:32
> An: SAS-L@LISTSERV.UGA.EDU
>
>
>
>
> Antwort an: David <david5705@HOTMAIL.COM>
>
> Betreff: Generate a separate window when SAS encounters a
pre-defined condition / error
> Nachrichtentext:
>
> Dear All:
>
> If SAS encounters a predefined condition within a data step ? e.g.,
> values for a variable are larger than a preset maximum, or a certain
> error return code is generated by SAS - is it possible to generate a
> new window with a preset error message (related to that condition
> being violated) and to stop SAS executing further statements (in a
> Windows NT, SAS 8.02 environment)?
>
> Ideally I would like the window to appear on the monitor regardless of
> whether SAS is running in the background or not.
>
> I've found some examples using %sysrc where predefined
> notes/warnings/errors can be added to the log file, but is there a way
> to use both %sysrc and %window to generate a new window, without the
> message being added to the log file? I would want to build the code
> within a data step, and outside of AF / SCL.
>
> Thanks for any feedback,
>
> David
>
>
>
>
>
> --
>
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
>
> This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
|