M3Lba
M3Lba

Reputation: 143

Variable names incompatible between SPSS and SAS

I imported an SPSS (.sav file) into SAS. Several of the variables are not showing up as they are named things like 'variable___1.1' When i try to KEEP certain variables in a data step, I get an error because these variables create an error as SAS misinterprets the '.'

Has anyone encountered this before or know a way around it?

I can see the problem variables and their values in the .sas7bdat file, so the data imported, I just need to find a way to change the variable name so I can include it in the report.

Upvotes: 0

Views: 125

Answers (1)

Reeza
Reeza

Reputation: 21274

You use name literal notation, 'variable1_1'n in your code, e.g.

rename 'variable___1.1'n = variable1_1; 

Or set this option and reimport your data so that you get better names.

option validvarname=v7; 

That will tell SAS to import the data with simpler variable names. Note that I'm not sure if that's two underscores or three or four in the variable name....guessing at 3.

Upvotes: 0

Related Questions