Date: Thu, 8 Mar 2012 05:35:10 -0500
Reply-To: coxspss@cox.net
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: David Wright <coxspss@cox.net>
Subject: Re: change case on variable labels
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=no
Thanks Bruce & John. After I saw your post I saw that the solution was
staring me in the face. I have the original syntax for this spss file
so it was easy as you suggested to simply pull in the variable names in
Word & make the case change. It's not necessary for our spss users and
is a small pain to make the change but for our non-spss users &
reporting services which use our oracle databases we have to upload our
spss files to the database which we do via syntax (using the syntax from
the export database wizard) and this normally goes smoothly. But for
our larger files we need to do bulk inserts (otherwise it would take
hours for the load). In both the MS sql server & oracle server
environments, this requires us to export the spss file as a csv which is
then uploaded via a format file on the sql side for bulk inserting. On
the MS sql server side, mixed case variable names are not a problem but
on the oracle side the batch utility our dba uses requires upper case.
Thanks again for your help as always...
On Wed, Mar 7, 2012 at 4:22 PM, Bruce Weaver wrote:
> David, do you mean that you have something like this
>
> variable labels
> v1 "First_name"
> v2 "Last_name"
> v3 "Age"
> v4 "Sex"
> .
>
> ...and you want it to look like this?
>
> VARIABLE LABELS
> V1 "FIRST_NAME"
> V2 "LAST_NAME"
> V3 "AGE"
> V4 "SEX"
> .
>
> If so, you could simply copy the relevant syntax into Word, and use
> Format-Change Case to change to uppercase, then paste back into your
> syntax
> file.
>
> Alternatively, you could read the entire syntax file into SPSS (via
> GET
> DATA), use UPCASE to change everything to uppercase, then write it
> back out
> to a syntax file with WRITE OUTFILE. E.g.,
>
> GET DATA
> /TYPE=TXT
> /FILE="C:\Temp\MySyntax.sps"
> /FIXCASE=1
> /ARRANGEMENT=FIXED
> /FIRSTCASE=1
> /IMPORTCASE=ALL
> /VARIABLES=
> /1 V1 0-59 A60.
> CACHE.
> EXECUTE.
>
> * Depending on the length of your lines of syntax, you may
> * need to alter the number of columns & formatting for V1 above.
>
> COMPUTE V1 = UpCase(v1).
> WRITE OUTFILE = "C:\Temp\MySyntaxUpCase.sps" / v1 .
> EXECUTE.
>
> The Pythonistas will probably find this terribly old-school, but it
> works.
> ;-)
>
> HTH.
>
>
>
> David Wright-6 wrote
>>
>> I have a sp file that has mixed case variable labels (e.g.,
>> Last_name).
>> I need to change the case on all variable labels to upper case (e.g.,
>> LAST_NAME). We are performing some oracle based bulk inserts & the
>> program we're using wants the column names to be upper case. Didn't
>> know if this was possible via straight syntax, no python please.
>> Thanks
>> in advance.
>>
>> David
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>> LISTSERV@.UGA (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>
>
> -----
> --
> Bruce Weaver
> bweaver@lakeheadu.ca
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
> NOTE: My Hotmail account is not monitored regularly.
> To send me an e-mail, please use the address shown above.
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/change-case-on-variable-labels-tp5545717p5545808.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except
> the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|