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 (July 2004)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 1 Jul 2004 10:48:05 -0400
Reply-To:   David.Jacobowitz@uvm.edu
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   David Jacobowitz <David.Jacobowitz@uvm.edu>
Organization:   ASEBA
Subject:   Re: Detecting SPSS 12 (add'l note)
Comments:   cc: "Peck, Jon" <peck@spss.com>, "Alan B. Howard" <abh@zoo.uvm.edu>
In-Reply-To:   <06F4FFE29EF3454D86A2E43487DC287B04375F9E@hqemail1.spss.com>
Content-Type:   text/plain; charset=ISO-8859-1; format=flowed

Dear List,

In order to write code that can be used in SPSS 12 with long variable names and also with previous versions, I took the advice from this list to write out a text file and read it back in with short variable names.

Even though the three date fields seem to be written and read as A9, those with missing values are written with only 8 positions.

Needless to say, this throws off the subsequent data.

My consultant tells me that one cannot specify missing values for alpha fields wider than 8 positions.

Does anyone have a suggestion to work with the write-read or a better way to reconcile SPSS 12 long var names with previous version limit to name length?

Thanks,

Dave Jacobowitz

WRITE OUTFILE= tempdata /ALL . execute. DATA LIST FILE= tempdata / subjectno (F7.2) id (A12) firstnam (A15) middlena (A15) lastname (A20) othernam (A20) gender (A1) dob (A9) ethnicco (A2) formver (A4) dataver (A4) formno (F7.2) formid (A3) type (A3) enterdat (A9) dfo (A9) age (A3) agemonth (A2) ................. snip

Data List will read 1 records from C:\Working\Code\A2S_12\Sav_Data\tempdata.txt

Variable Rec Start End Format

subjectn 1 1 7 F7.2 id 1 8 19 A12 firstnam 1 20 34 A15 middlena 1 35 49 A15 lastname 1 50 69 A20 othernam 1 70 89 A20 gender 1 90 90 A1 dob 1 91 99 A9 ethnicco 1 100 101 A2 formver 1 102 105 A4 dataver 1 106 109 A4 formno 1 110 116 F7.2 formid 1 117 119 A3 type 1 120 122 A3 enterdat 1 123 131 A9 dfo 1 132 140 A9 age 1 141 143 A3 agemonth 1 144 145 A2 ........... snip

==== TempData.txt. Hope it doesn't wrap so you can't see the missing dates are 8 positions ======= 571.00000020 M - - ET20012001 1055.00 CBC30-Jun-04 - - 09 572.00000021 F - - ET20012001 1056.00 CBC30-Jun-04 - - 10 573.00000022 M - - ET20012001 1057.00 CBC30-Jun-04 - - 11 574.00000023 F - - ET20012001 1058.00 CBC30-Jun-04 - - 12 575.00000036 M - - ET20012001 1059.00 CBC30-Jun-04 - - 13 576.00000037 F - - ET20012001 1060.00 CBC30-Jun-04 - - 14 577.00000039 M - - ET20012001 1061.00 CBC30-Jun-04 - - 15 578.00000040 F - - ET20012001 1062.00 CBC30-Jun-04 - - 16 579.00000041 M - - ET20012001 1063.00 CBC30-Jun-04 - - 17 580.00000042 F - - ET20012001 1064.00 CBC30-Jun-04 - - 18

Peck, Jon wrote:

>I posted a script for this a few months ago. You can find it on Raynald's site. Follow the long variable names link at > >http://pages.infinit.net/rlevesqu/SampleScripts.htm#IndexSampleScripts > >This produces 8-byte names, but these will not always be the same as what was produced when reading non-SPSS data sources in previous versions, because different data sources had different algorithms for shortening names, and these were all unified into a single scheme in SPSS 12. > >Note also, that if you are concerned about sharing a sav file with long names with someone using an older version of SPSS, the short names will magically appear when the file is opened in the older version. > >Regards, >Jon Peck > >-----Original Message----- >From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of San Kumaradevan >Sent: Wednesday, June 02, 2004 3:00 AM >To: SPSSX-L@LISTSERV.UGA.EDU >Subject: Re: [SPSSX-L] Detecting SPSS 12 (add'l note) > >Hi, >Wouldn't it be nice to have a script which automatically truncates the variable names to 8 character? Anyone got a ready made script? :) > >- San > >

-- David.Jacobowitz@uvm.edu 802.264.6420 ASEBA - Child Behavior Checklist <mailto:mail@ASEBA.org> http://www.ASEBA.org/ http://www.uvm.edu/~djacobow


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