10-10-2014 05:42 AM
How to stop the saving my code,If my code having any error or any warning or any unwanted Note in the log Window.
Please help me out, Since i don't have any idea how to achieve this.
Thanks in advance.
10-10-2014 06:09 AM
Sorry, I really don't understand the question here, do you mean you want to stop code that is currently running if it encounters an error? If so then you would need to provide some more specific information such as where the code is running, what it is doing etc. For instance there is the SYSERR automatic macro variable you could check, something like:
data a; set b; run;
%if &syserr.=0 %then %do; /* If run succesfull */
There maybe other things to consider also though, files being moved, what you are running on etc.
10-10-2014 07:16 AM
Thanks for looking into my question, Here Criteria is different.
Here While saving my code to XYZ Location, If any error or warning or unwanted note is in my log window, It should not save the code. moreover it should pop-up us with telling that some error or warning is their in the log.
If any concerns please let me know.
Thanks & Regards,
10-10-2014 07:49 AM
Sorry, again not following you. Do you mean you are running a program and within a datastep you don't want to store something if there is an error? If so then this is automatic, SAS wouldn't write a full dataset if there are errors in the datastep. Do you mean saving your actual program. Also what do you mean by message should pop up, is this log checking at the end of execution?
Log checking would be something you do at then to see if execution happened correctly, you could do it in a SAS program and email out an message if there are warnings/errors. Or your batch scheduler could do that. If you mean when you are running interactively in SAS, then just submit your program step by step (highlight and run), that way only the code you highlight will run. If you mean saving actual SAS code files then there is no log associated, it is just a plain text file, if you need audit history/rollback etc then look at version control software such as TortoiseSVN to track code files.
10-10-2014 07:58 AM
It's up to you to check the log before saving a program file. Even in EG, you only get a visual signal (red x on errors, yellow exclamation mark on warnings) in certain conditions, NOTEs about unitialized vars etc go unnoticed unless you check the log with eyeballs Mk I. It's what you get paid for as a developer.