BookmarkSubscribeRSS Feed
JaySwan
Calcite | Level 5

EG 4.1 imports a MS Access table which has invalid column names, as an example

2009 subs total

Total # Of Subs

.... etc....

I look at the generated code by sas and it creates  _T_ value to process the observations, and creates the SAS Dataset.

The strange thing is that SAS outputs the dataset with non-standard variable names, which causes me the problem.

I would have thought SAS would have kept the _T_ or someting like that...

I want to re-name all the variables to someting like:

Rename 2009 subs total = Y2009_Subs_Total;

But SAS looks at the 2009 as a numeric not as a variable name...

Any ideas on how I can take a variable named 2009 subs total and rename it to Y2009_Subs_Total?

TIA, Jay

3 REPLIES 3
art297
Opal | Level 21

State the variable name as a name literal in your rename statement.  see:

http://support.sas.com/documentation/cdl/en/lrcon/62753/HTML/default/viewer.htm#p18cdcs4v5wd2dn1q0x2...

You would have to have the validvarname=any option set as well

JaySwan
Calcite | Level 5

Ah, just figured it out the 'n option works, it takes the 'value of' the 'string' not the string... cool....

Ksharp
Super User

For SAS/EG system option validvarname= is set 'any' by default.

You should set it back at the first of your code . validvarname=v7.

Ksharp

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1114 views
  • 0 likes
  • 3 in conversation