BookmarkSubscribeRSS Feed
Jiordani
Calcite | Level 5

Hello, I've been trying to rename all the variables that start with a state, and end with something like !!Housholds!!Estimate and I keep getting the Error 20-200 saying:

"Alphabetic prefixes for enumerated variables (Alabama-Estimate) are different. 

Old and new variable name specifications for RENAME must be of the same type. Statement is ignored.

 

And Error 22-322 says: Syntax error, expecting one of the following: -, :, =.

The symbol is not recognized and will be ignored.

 

I want to change all the variables to a shorted postal abbreviation of the corresponding state. For example I want the variable Alabama!!Housholds!!Estimate to be just AL.

 

Also, none of my data copied from the first data set to the second dataset, but I created that second dataset. The second dataset just has all of the original variables, but with no observations.

Jiordani_0-1669787659496.png

 

Jiordani_4-1669788122037.png

 

This one is the first dataset RegPro.IncoSt

Jiordani_2-1669787911289.png

 

This one is the second dataset RegPro.IncoSt1

Jiordani_3-1669788045776.png

 

1 REPLY 1
Kurt_Bremser
Super User

A name with exclamation marks is a non-valid name, unless you have

options validvarname=any;

set. In which case you must use a name literal:

'Alabama!!Housholds!!Estimate'n

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 441 views
  • 0 likes
  • 2 in conversation