|
|
Re: PROC DATASETS but only when no errors
that depends on, what is a error. With a syntax error, the rest of the
code is not executed. With some data errors? Depends on.
You can influence the behaviour with some options, like errorabend and
others. (Attention, don't use that in a online session! While testing
you'll get many ended sessions with that)
All that is rather "global" and might not reflekt that what you mean with
errors.
It might be a better way to have more influence at that point where
certain erros occure. That you can do with the
abend return nn
statement. That brings you a abend code which you need to see where it
happens and what happens. Normally that statement is executed
conditionally. "if error then do; abend...; end; And other steps are not
executed after the abend.
Is that what you need?
Otherwise you can use some of the automatic macro variables and include
all what you want to do or not to do in a macro. With that you can control
which code is generated.
Gerhard
On Tue, 17 Nov 2009 08:36:35 -0800, theorbo <theorbo@GMAIL.COM> wrote:
>Hi - I want to delete intermediate (but permanently created) datasets
>with PROC DATASETS but I only want to do this if there have been no
>errors.
>
>My intermediate files take a long time to create and I end up
>combining them all but I do not want to delete all the intermediate
>files if there was some error.
>
>How can I conditionally run PROC DATASETS? Would the _IORC_ error
>variable be useful here? Or would PROC DATASETS not execute by
>default upon some other error?
>
>Thanks.
|
|
0
|
|
|
|
Reply
|
gerhard.hellriegel (2531)
|
11/17/2009 6:00:32 PM |
|
I have a utility macro I got from Tom Hoffman that I use for this type
of problem. It is intended to interrupt a program when it has an
error. The error condition and message are inputs to the macro so each
program can decide what constitutes an error and how to explain that
error to the user.
If the condition is false it does nothing and the program continues.
Otherwise it will write the error message to the LOG. Then if running
in background (or with ERRORABEND set) it will abend the program.
Otherwise when running in the foreground it will open a display window
with the error message and wait for an input. This way the user can
decide whether to cancel the submitted program while SAS is waiting
for them to respond to the error message.
- Tom Abernathy
On Nov 17, 1:00=A0pm, gerhard.hellrie...@T-ONLINE.DE (Gerhard
Hellriegel) wrote:
> that depends on, what is a error. With a syntax error, the rest of the
> code is not executed. With some data errors? Depends on.
> You can influence the behaviour with some options, like errorabend and
> others. (Attention, don't use that in a online session! While testing
> you'll get many ended sessions with that)
> All that is rather "global" and might not reflekt that what you mean with
> errors.
> It might be a better way to have more influence at that point where
> certain erros occure. That you can do with the
>
> abend return nn
>
> statement. That brings you a abend code which you need to see where it
> happens and what happens. Normally that statement is executed
> conditionally. "if error then do; abend...; end; And other steps are not
> executed after the abend.
>
> Is that what you need?
>
> Otherwise you can use some of the automatic macro variables and include
> all what you want to do or not to do in a macro. With that you can contro=
l
> which code is generated.
>
> Gerhard
>
>
>
> On Tue, 17 Nov 2009 08:36:35 -0800, theorbo <theo...@GMAIL.COM> wrote:
> >Hi - I want to delete intermediate (but permanently created) datasets
> >with PROC DATASETS but I only want to do this if there have been no
> >errors.
>
> >My intermediate files take a long time to create and I end up
> >combining them all but I do not want to delete all the intermediate
> >files if there was some error.
>
> >How can I conditionally run PROC DATASETS? =A0Would the _IORC_ error
> >variable be useful here? =A0Or would PROC DATASETS not execute by
> >default upon some other error?
>
> >Thanks.- Hide quoted text -
>
> - Show quoted text -
|
|
0
|
|
|
|
Reply
|
Tom
|
11/17/2009 11:28:09 PM
|
|
Thanks to both of you ... I wasn't aware of the ERRORABEND system
option and that seems to get me in the right direction, basically not
wanting to delete my intermediate files if I haven't successfully
combined them all into a final file. Tom, is the macro posted online
somewhere? I haven't searched yet but will if it is publicly
available. Again, thanks to you both.
On Nov 17, 6:28=A0pm, Tom Abernathy <tom.aberna...@gmail.com> wrote:
> I have a utility macro I got from Tom Hoffman that I use for this type
> of problem. It is intended to interrupt a program when it has an
> error. The error condition and message are inputs to the macro so each
> program can decide what constitutes an error and how to explain that
> error to the user.
>
> If the condition is false it does nothing and the program continues.
> Otherwise it will write the error message to the LOG. =A0Then if running
> in background (or with ERRORABEND set) it will abend the program.
> Otherwise when running in the foreground it will open a display window
> with the error message and wait for an input. This way the user can
> decide whether to cancel the submitted program while SAS is waiting
> for them to respond to the error message.
>
> - Tom Abernathy
>
> On Nov 17, 1:00=A0pm, gerhard.hellrie...@T-ONLINE.DE (Gerhard
>
>
>
> Hellriegel) wrote:
> > that depends on, what is a error. With a syntax error, the rest of the
> > code is not executed. With some data errors? Depends on.
> > You can influence the behaviour with some options, like errorabend and
> > others. (Attention, don't use that in a online session! While testing
> > you'll get many ended sessions with that)
> > All that is rather "global" and might not reflekt that what you mean wi=
th
> > errors.
> > It might be a better way to have more influence at that point where
> > certain erros occure. That you can do with the
>
> > abend return nn
>
> > statement. That brings you a abend code which you need to see where it
> > happens and what happens. Normally that statement is executed
> > conditionally. "if error then do; abend...; end; And other steps are no=
t
> > executed after the abend.
>
> > Is that what you need?
>
> > Otherwise you can use some of the automatic macro variables and include
> > all what you want to do or not to do in a macro. With that you can cont=
rol
> > which code is generated.
>
> > Gerhard
>
> > On Tue, 17 Nov 2009 08:36:35 -0800, theorbo <theo...@GMAIL.COM> wrote:
> > >Hi - I want to delete intermediate (but permanently created) datasets
> > >with PROC DATASETS but I only want to do this if there have been no
> > >errors.
>
> > >My intermediate files take a long time to create and I end up
> > >combining them all but I do not want to delete all the intermediate
> > >files if there was some error.
>
> > >How can I conditionally run PROC DATASETS? =A0Would the _IORC_ error
> > >variable be useful here? =A0Or would PROC DATASETS not execute by
> > >default upon some other error?
>
> > >Thanks.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
|
|
0
|
|
|
|
Reply
|
theorbo
|
11/18/2009 3:40:36 AM
|
|
|
2 Replies
362 Views
(page loaded in 0.089 seconds)
|
|
|
|
|
|
|
|
|