[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: How to rerun a failed datastep
From:       Scott Barry <sbarry () SBBWORKS ! COM>
Date:       2010-01-31 20:02:47
Message-ID: 201001312002.o0VBkpkd020603 () malibu ! cc ! uga ! edu
[Download RAW message or body]

On Sun, 31 Jan 2010 00:22:15 -0800, TheSharpOne <sharp131@HOTMAIL.CO.UK> wrote:

>I have a piece of sas code which contains  30ish extremely simple
>datasteps which just extract from an SQL database into a data table:
>eg
>data SASTable.Customer;
>  Set SQL.Customer;
>  Keep CustomerID
>           CustomerName;
>Run;
>On a seemingly random basis the above will fail (something I'm looking
>into but want to have a work around in the interim)
>
>Obviously I can write some code that holds the above in a macro say
>and then checks to ensure the step is successful and if not retrys the
>step until it is successful but if I want to do this for each datastep
>I have to write 30ish macros (one for each step).
>
>Is there any way to determine the code of the last step and then rerun
>this with having to create a macro around each datastep
>
>Thanks in advance

I expect in your post, the reference in the last sentence to "with" should
be "without" -- correct?

So, explore using the SYSERR automatic variable and you may want to consider
using a DATA step approach with CALL EXECUTE, either to execute code
specified as the first argument to the function or by executing a %INCLUDE,
as preferred.

You can see your automatic macro variables at any time using the code below:

%PUT _AUTOMATIC_;


Scott Barry
SBBWorks, Inc.


Recommended Google advanced search arguments for this topic/post:

data step detect error condition site:sas.com

syserr site:sas.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic