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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 3 replies
  • 663 views
  • 0 likes
  • 3 in conversation