DATA Step, Macro, Functions and more

ERROR CODES AND ERROR MESSAGES

Reply
Contributor
Posts: 31

ERROR CODES AND ERROR MESSAGES

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

Super User
Posts: 9,868

Re: ERROR CODES AND ERROR MESSAGES

Please don't shout at us.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 31

Re: ERROR CODES AND ERROR MESSAGES

Posted in reply to KurtBremser

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

Contributor
Posts: 31

Re: ERROR CODES AND ERROR MESSAGES

Posted in reply to KurtBremser

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.

Super User
Posts: 9,868

Re: ERROR CODES AND ERROR MESSAGES

You might look at the possible values of the SYSERR automatic variable.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 31

Re: ERROR CODES AND ERROR MESSAGES

Posted in reply to KurtBremser

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....

Super User
Posts: 9,868

Re: ERROR CODES AND ERROR MESSAGES


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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 31

Re: ERROR CODES AND ERROR MESSAGES

[ Edited ]
Posted in reply to KurtBremser

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

 

Super User
Posts: 9,868

Re: ERROR CODES AND ERROR MESSAGES

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 31

Re: ERROR CODES AND ERROR MESSAGES

Posted in reply to KurtBremser

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?

 

Super User
Posts: 9,868

Re: ERROR CODES AND ERROR MESSAGES


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)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 10 replies
  • 171 views
  • 0 likes
  • 2 in conversation