BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

Is there a good way to do error handling in proc fcmp and throw an error message to the SAS log in red font?  

The only way I have been handling error messages in fcmp is by doing something like this:

if lettercase not in("U", "L") then do;
     put  "ERROR The second argument to the letters function must be one of U, u, L, or l."; 
     return(-1);
end;

but this only writes the message to the log in standard black font.  I want the font to mirror the SAS system error messages.  Also, is there a preferred or specific value I shoudl be returning for errors?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
Tom
Super User Tom
Super User

Why didn't you include the colon?

image.png

statistician13
Quartz | Level 8

Ahhh.  Thanks.  I didn't realize I simply had to put in a colon.  That worked!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1428 views
  • 1 like
  • 2 in conversation