BookmarkSubscribeRSS Feed
dishant
Calcite | Level 5

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

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

dishant
Calcite | Level 5

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

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Kurt_Bremser
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 828 views
  • 0 likes
  • 3 in conversation