Date: Thu, 6 Oct 2011 10:25:31 -0400
Reply-To: Quentin McMullen <qmcmullen.sas@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Quentin McMullen <qmcmullen.sas@GMAIL.COM>
Subject: Re: variable name truncation during import
Content-Type: text/plain; charset=ISO-8859-1
Thanks, I like that feature when importing from Excel. Unfortunately
these data already have variable labels in SPSS, and PROC IMPORT
preserves the labels when it pulls them in.
On Thu, Oct 6, 2011 at 10:17 AM, Data _null_; <email@example.com> wrote:
> Often IMPORT will make the SAS Variable Label equal to the column
> header. What did it do for your data?
> On Thu, Oct 6, 2011 at 8:54 AM, Quentin McMullen
> <firstname.lastname@example.org> wrote:
>> I am importing data from SPSS to SAS, using PROC IMPORT dbms=SPSS.
>> After cleaning the data in SAS, will need to export it back to SPSS in
>> the same format.
>> Unfortunately, SPSS lets variables names be longer than 32 characters.
>> PROC IMPORT truncates them to be 32 characters during import.
>> Was wondering if there is any way to have SAS create a lookup table
>> that would link the original long SPSS variable name to the truncated
>> SAS variable name. If I could get that as a dataset, I could use it
>> to map my truncated variable names back to the insanely long names
>> after I have exported the data back to SPSS.
>> Seems like at some point the ODBC driver or DBMS copy engine or
>> whatever magical middleware is doing the work knows the long variable
>> names, because the truncation is fairly intelligent.
>> Is there a way to get this information from SAS? Or do I need to
>> resort to jumping into SPSS land to write a macro there that will
>> shorten the variable names and create the lookup table before I import
>> to SAS?
>> Kind Regards,