Help using Base SAS procedures

how to check error location

Reply
Regular Contributor
Posts: 208

how to check error location

[ Edited ]

Hello,

when SAS error happen, there is a message:

 

"ERROR 180-312: The symbol is not recognized and will be ignored."

 

what does the 200-322 here mean? error's location? how to use this information?

 

Thanks!

Super User
Posts: 6,963

Re: how to check error location

The position of the message indicates (in the line above) the location that SAS complains about.

That does not mean the cause is actually there. Often the wrong syntax comes earlier in the code (like a missing semicolon).

 

If you post the relevant log portion (use the {i} icon, so formatting is preserved), we might be able to finde the cause for the message.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Regular Contributor
Posts: 208

Re: how to check error location

Thank you, can you show me how to use the {i} icon??

Thank you very much!
Super User
Posts: 6,963

Re: how to check error location

When you create a post, on top of the text area you find a sequence of icons:

Formatting: bold, italic, underlined, strikethrough, spoiler tag

The next icon after the little vertical line is the {i}, followed by the running man symbol that opens a window for posting SAS code

Both of these use a fixed-space font; while the option for entering SAS code also adds syntax highlighting, the {i} does not and is therfore good for showing example data or log excerpts.

Just click on the {i} and paste the log part into the window that opens.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Regular Contributor
Posts: 208

Re: how to check error location

[ Edited ]
53   data a;
54    h t2y ;
      -
      180
ERROR 180-322: Statement is not valid or it is used out of proper
               order.

55   run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.A may be incomplete.  When this step was
         stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.A was not replaced because this step was
         stopped.

This is an example of error log of the following simple SAS code:

 

data a;

h t2y ;

run;

 the question is how to explain : "180-322:"

Thanks!

Super User
Posts: 5,090

Re: how to check error location

George,

 

180-322:  Statement is not valid ...

 

This is SAS's way of giving up.  It says that you made an error, but SAS can't figure out a message to supply that would help you correct the problem.

 

There is no "h" statement in SAS.  What is this statement supposed to accomplish:

 

h t2y;

Regular Contributor
Posts: 208

Re: how to check error location

[ Edited ]

h t2y is just an example to get the error.

Super User
Posts: 6,963

Re: how to check error location

180-322 is your basic syntax error message: what you wrote is not allowed here, period. It's either rubbish (non-SAS text) or SAS code that might be valid in another place (happens if you accidentally entered a semicolon before some words that still belong to the previous statement)

eg

data x;
(compress=yes);
set .....
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 7 replies
  • 350 views
  • 0 likes
  • 3 in conversation