BookmarkSubscribeRSS Feed
DOBBINHO
Obsidian | Level 7

IS THERE A LIBRARY CONTAINING ALL POSSIBLE ERROR CODES AND THEIR RESPECTIVE ERROR MESSAGES?

IF NOT IS THERE A POSSIBLE WAY TO PINPOINT AN ERROR USING ERROR CODES PRODUCED BY SYSCD() AND &SYSERR.

I AM TRYING TO USE THAT FOR A PROJECT, BUT I AM UNABLE TO IDENTIFY HOW THESE ERROR CODES WORK. PLEASE COMMENT WITH SUGGESTIONS ON THE SAME. USING SAS VERSION 9

12 REPLIES 12
DOBBINHO
Obsidian | Level 7

Sorry about that. was typing and talking at the same time and didn't notice the caps lock was on.

DOBBINHO
Obsidian | Level 7

Thanks for the advice, but I'm actually trying to work on a way for the program to debug itself. The primary requirement is to make a database of all different kinds of error messages and codes. which is what I'm trying to do.

DOBBINHO
Obsidian | Level 7

Even the syserr automatic variable values do not particularly point out to any specific error. I want to know a way by which I can identify the type of specific error, and thus correct the same subsequently....

Kurt_Bremser
Super User

@DOBBINHO wrote:

Even the syserr automatic variable values do not particularly point out to any specific error. I want to know a way by which I can identify the type of specific error, and thus correct the same subsequently....


There is a very simple, time-proven method to deal with ERRORs and WARNINGs: the programmer reads the log and fixes the code. We're still very far away from expert systems that can do this automatically.

Certain problems caused by the environment can be signaled to the operators of the scheduler by setting specific error codes (eg "not enough input records", "non-unique key in input data") to facilitate correction without programmer intervention, but that's it. For these cases I have specific code in the programs, but there's no "swiss army knife" that works over all possible issues.

DOBBINHO
Obsidian | Level 7

Isn't it possible to create this swiss army knife?

I mean I know its too much to ask, but there is always a solution to every problem. If only there was a way to compile all of these "issues", i.e; make a Database out of it, Thus making it more probable than the predicament it is now

 

Kurt_Bremser
Super User

Oh, I own such a swiss army knife. It sits between my ears.

 

In earnest, you'd spend way more time on creating (and constantly expanding/maintaining) that helper than you will ever spend maintaining/fixing code.

If such a thing made any economic (in terms of time spent) sense, it would already be here.

DOBBINHO
Obsidian | Level 7

I get that.... Ok to start off, is there a way to run a code to find out syntax errors in a program?

For example, I have a template code. My validation code should perform a set of pre-checks.

A) To check for syntax errors

B)to be defined

C)to be defined

 

The points B and C shall be defined later.

So what do I need to do in order to get the same?

 

Kurt_Bremser
Super User

@DOBBINHO wrote:

A) To check for syntax errors


 

That's very easy. Run it in batch, a syntax error will end up with a return code of 2.

If you run it from a GUI, you'll be notified visually ("red cross" in EG, for example)

ballardw
Super User

@DOBBINHO wrote:

Thanks for the advice, but I'm actually trying to work on a way for the program to debug itself. The primary requirement is to make a database of all different kinds of error messages and codes. which is what I'm trying to do.


One reason this is likely to be an issue is that if you ever connect to another program, for example an external data base or ODBC are likely places, the errors returned could be from the external source. So even if you have every possible SAS error code it does nothing to help with Oracle, SQL Server or similar. If you are using tools such as Proc HTML to access website based date then have the whole gamut of HTML errors added.

 

 

avellani
Fluorite | Level 6
hahaha

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
  • 12 replies
  • 2635 views
  • 2 likes
  • 4 in conversation