BookmarkSubscribeRSS Feed
Kirito1
Quartz | Level 8

I was trying to convert a column into numeric which was a string.

data AN;
set CUSTAVG;               
   value2=input('ANO'n,8.);     
   put value2 =;                
run;

But, its giving me an error.

Kirito1_0-1672980422408.png

I know its a simple task but I cannot do it. Please, Help!!

2 REPLIES 2
ballardw
Super User

Provide the entire log of the data step, not just the error message. Also, copy the text from the log and on the forum open a text box and paste the text. The entire text is needed as we cannot tell which line of your code may have generated the error and often the actual cause may be from an earlier statement such as missing a semicolon or unbalanced parentheses or quotes.

The text box is important because the forum software will reformat text in the main message windows. The TEXT, not picture, is important as it is easier to copy/paste/edit than to retype an entire picture's worth of text.

 

You may want to run this bit code:

Proc options option=validvarname;run;

If the log shows this as a result:

 VALIDVARNAME=V7   Specifies the rules for valid SAS variable names that can be created and  processed during a SAS session.

That would mean your current session does not allow name literals like 'ANO'n. If it shows VALIDVARNAME=ANY then something else is wrong and we can't tell without more details.

 

I am curious why you think that you need to use a name literal as those are needed when your variable has characters not normally allowed in names and ANO would not need such.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 372 views
  • 1 like
  • 3 in conversation