Help using Base SAS procedures

WARNING: Variable N has already been defined as numeric.

Reply
N/A
Posts: 0

WARNING: Variable N has already been defined as numeric.

I know that this was okay in 9.13 of SAS base previously (CC=0), and now gets a warning message with a CC=4 now, and I'm okay with that, but I would like to have the warning removed and go back to a CC=0 to have things cleaned up.

What do I have to do to make this happen?

code is as follows:
199 + IF _N_ = 1 THEN DO N=1 TO &NUMGRPS;
200 + GRPN{N}=PUT(N,$GNAME.);
WARNING: Variable N has already been defined as numeric.
201 + END;

Help appreciated.
Super Contributor
Super Contributor
Posts: 3,174

Re: WARNING: Variable N has already been defined as numeric.

A related PROBLEM NOTE on SAS.COM support website (I used SEARCH to find it). You are using a numeric SAS variable "N" against a character SAS format, which is causing the WARNING message condition.

Suggest you make a code tightening correction (my words) and use a PUT function against the "N" NUMERIC type variable with consideration for the length of &NUMGRPS, as shown below:

PUT(N,5. -L )

Problem Note 35428: Warning messages that incorrectly produce a RC=0 now correctly produce a RC=4 in SAS 9.2
http://support.sas.com/kb/35/428.html
N/A
Posts: 0

Re: WARNING: Variable N has already been defined as numeric.

Thanks SBB.

I had found the error list that you pointed out.

The resolution was as easy as you stated. I used the format without the dollar sign in front of the format error.

Thanks again
Ask a Question
Discussion stats
  • 2 replies
  • 907 views
  • 0 likes
  • 2 in conversation