Hi all,
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.
Regards,
Dishant
Hi,
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:
%macro test;
data a; set b; run;
%if &syserr.=0 %then %do; /* If run succesfull */
...
%end;
%mend test;
There maybe other things to consider also though, files being moved, what you are running on etc.
Hi,
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,
Dishant
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.
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.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.