Date: Tue, 15 Aug 2006 16:40:04 -0400
Reply-To: "Dorfman, Paul" <paul_dorfman@MERCK.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Dorfman, Paul" <paul_dorfman@MERCK.COM>
Subject: Re: can SAS be stopped conditionally from executing last part of
a code file in open code ?
Content-Type: text/plain
Rob,
That is what I had thought could do the trick, but as you have just amply
demonstrated, does not. Thinking of the situation further, I would not mind
if SAS implemented a simple (non-macro) statement/command, which would
merely play the role of moving program control directly past the last
submitted statement similar to the relatively newly fangled %RETURN in a
macro.
Kind regards
------------
Paul Dorfman
Jax, FL
------------
+-----Original Message-----
+From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
+Behalf Of Workman, Rob
+Sent: Tuesday, August 15, 2006 2:45 PM
+To: SAS-L@LISTSERV.UGA.EDU
+Subject: Re: can SAS be stopped conditionally from executing
+last part of a code file in open code ?
+
+
+Paul,
+
+You may be thinking of the WATTENTION command. This does bring up the
+control+break window, but it doesn't actually seem to cancel the
+submitted statements when you select the option. In this log snippet,
+you can see that that datastep TWO is created even though I
+selected "3.
+Cancel submitted statements" from the Tasking Manager window.
+
+
+377 data one;
+378 run;
+
+NOTE: The data set WORK.ONE has 1 observations and 0 variables.
+NOTE: DATA statement used (Total process time):
+ real time 0.01 seconds
+ cpu time 0.02 seconds
+
+
+379
+380 *** bring up the tasking window and select 3. Cancel submitted
+statements;
+381 dm 'wattention';
+382
+383 data two;
+384 run;
+
+NOTE: The data set WORK.TWO has 1 observations and 0 variables.
+NOTE: DATA statement used (Total process time):
+ real time 0.00 seconds
+ cpu time 0.00 seconds
+
+Kind regards,
+
+Rob Workman
+
+-----Original Message-----
+From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
+Dorfman, Paul
+Sent: Tuesday, August 15, 2006 11:59 AM
+To: SAS-L@LISTSERV.UGA.EDU
+Subject: Re: can SAS be stopped conditionally from executing last part
+of a code file in open code ?
+
+Richard,
+
+Please see below...
+
++-----Original Message-----
++From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
++Behalf Of Richard A. DeVenezia
++Sent: Tuesday, August 15, 2006 12:12 PM
++To: SAS-L@LISTSERV.UGA.EDU
++Subject: Re: can SAS be stopped conditionally from executing
++last part of a code file in open code ?
++
+<snip>
++
++The only Base way to conditionally execute ENDSAS is to use macro.
++--------------------------------
++%macro EndIt(really=0);
++ %if &really %then
++ENDSAS
++ ;
++%mend;
++
++%EndIt;
++%EndIt(really=1);
++--------------------------------
+
+Perhaps CALL EXECUTE() will do, too, and so will tempfile/%include, or
+basically anything capable of depositing ENDSAS for execution.
+
++ENDSAS is also a Display Manager command, a session can be ended with
++
++DM "ENDSAS";
+
+And herein lies the problem with ENDSAS. If I am running an interactive
+session and would like to terminated the program
+conditionally, what are
+my
+options short of coding all RUNs with CANCEL?
+
+Oh yes, controlling execution by a macro. But I have started disliking
+it a
+long time ago - primarily, because in the case of a run-time error,
+macro
+execution renders the SAS log impotent as a means of
+debugging. In batch
+this is no big deal - I can always eschew macros in favor of dynamic
+code
+generation using DATA step/SQL and %include, which has other advantages
+as
+well (e.g. I always keep generated code in permanent text files, and so
+I
+always know what was generated and executed, plus of course SOURCE2
+helps as
+well). And in batch, I can use ENDSAS to stop the program at any point.
+Obvioulsy, in an interactive session this is not an option, unless one
+does
+not care if the session is killed altogether or not.
+
+Dynamically creating a comment? I find it clever [particularly your
+version
+of it] but kludgy.
+
+Dynamically issuing a DM command telling SAS to stop the execution of
+the
+submitted code but remain in session? I would like to know that command
+of
+it exists. Perhaps it could be resurrected from the sequence ensuing
+when
+one interrupts the execution by clicking on the break button, but I do
+not
+know what is behind it.
+
+Kind regards
+------------
+Paul Dorfman
+Jax, FL
+------------
++
++--
++Richard A. DeVenezia
++http://www.devenezia.com/
++
++
+
+
+---------------------------------------------------------------
+---------
+------
+Notice: This e-mail message, together with any attachments, contains
+information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
+New Jersey, USA 08889), and/or its affiliates (which may be known
+outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
+and in Japan, as Banyu) that may be confidential, proprietary
+copyrighted and/or legally privileged. It is intended solely
+for the use
+of the individual or entity named on this message. If you are not the
+intended recipient, and have received this message in error, please
+notify us immediately by reply e-mail and then delete it from your
+system.
+---------------------------------------------------------------
+---------
+------
+
+---------------------------------------------------------------
+-------------------------------
+This message contains confidential information intended only
+for the use of the addressee(s).
+If you are not the addressee, or the person responsible for
+delivering it to the addressee, you
+are hereby notified that reading, disseminating, distributing
+or copying this message is strictly
+prohibited. If you have received this message by mistake,
+please notify us, by replying to the
+sender, and delete the original message immediately
+thereafter. Thank you.
+
+
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
------------------------------------------------------------------------------
|