LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 1 Apr 2011 04:54:31 -0400
Reply-To:     Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:      Re: Invalid Variable Names from SPSS file

you can try it with

data fixnames;

set DatasetName;

rename "q1.6"n = q1_6;

run;

Gerhard

On Fri, 1 Apr 2011 11:18:13 +1300, Mark Emmett <mark.emmett@TWENTY.CO.NZ> wrote:

>Hello, > >I've imported a dataset from SPSS using proc import (dbms = SAV) and some of >the variable names have a period character in them (e.g. "q1.6"). > > > >I need to rename these, as they can't be used in SAS, but I can't use a >rename statement since SAS won't accept the name in the first place. Any >ideas? > > > >An example of my code and errors follows: > > > > > >proc import out=work.DatasetName > > datafile='path\dataset.sav' > > dbms=SAV replace; > >run; > > > >data fixnames; > > set DatasetName; > > rename "q1.6" = q1_6; > >run; > > > >1377 data fixnames; > >1378 set DatasetName; > >1379 rename "q1.6" = q1_6; > > ^ > >ERROR: Found ""q1.6"" when expecting a name > >1380 run; > > > >NOTE: DATA step was not executed because of errors detected > >NOTE: The data step took : > > real time : 00:00:00.015 > > cpu time : 00:00:00.000 > > > >Thanks! > >Mark > > > >Mark Emmett >Senior Insights Analyst | twenty > >ddi | +64 9 302 7386 >mob | +64 21 320 205 >web | twenty.co.nz >Level 1, 24 Wyndham Street, Auckland


Back to: Top of message | Previous page | Main SAS-L page