BookmarkSubscribeRSS Feed
Soujanya2
Calcite | Level 5

Hi All,

 

I am using options EERORABEND to stop the sas processing when error occurs, but this option is not able to stop the job and creates empty output files despite of errors.

 

Is there is a way to restrict the job from not creating the outputfiles if there are any errors.

 

Thanks,

Soujanya.

4 REPLIES 4
Amir
PROC Star

Hi,

 

Have you tried looking into the syscc documentation, which "Contains the current condition code that SAS returns to your operating environment (the operating environment condition code)."

 

You can make the production of the files conditional upon syscc being equal to 0 (zero).

 

If this does not suit your needs then please say why not, and edit your question to give more context on how your code is structured, etc.

 

 

Kind regards,

Amir.

ballardw
Super User

Are you sure that the "files" were not left over from a previous successful run of the code? If you do not delete data sets prior to running then they may exist. Procedures may reuse previous data.

 

Also any output created prior to the encountering the error would exist ( and is often helpful in diagnosing what eventually created the error). Are you expecting such output to be deleted when the whole program Abends?

Soujanya2
Calcite | Level 5
Hi @ballardw,

Yes there wont be any file left over, because each day unique file will be created with the rundate of today. Output file is getting created even after encountering the error, I want to stop the program from not creating the output files even though there is one single error in the job.
Kurt_Bremser
Super User

ERRORABEND will react to most, but not all ERRORs, therefore not everything that you view as an error.

 

So please show the piece of code that creates the ERROR after which you want to stop processing. Ideally, post the log from an actual "problem run".

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 579 views
  • 0 likes
  • 4 in conversation