Date: Mon, 18 Mar 2002 20:58:49 -0500
Reply-To: Raynald Levesque <rlevesque@videotron.ca>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@videotron.ca>
Subject: Re: Can Raynald or anybody help ?
In-Reply-To: <A144B3611B47D21193330008C7246B760117CEC1@FHIEXNT0>
Content-Type: text/plain; charset="iso-8859-1"
Hi
this kind of problem is easier to solve when one has the data file
available.
There is nothing wrong with the
".".
at the end of the WRITE command.
The first 3 characters (".") are there to add a period at the end of each
ADD VALUE LABEL command in the temp.sps file.
The last . is the command terminator of the WRITE command.
One possible problem is if your variable kommun has quotes in it. This would
confuse the syntax, if you data have single quotes in it,then in the syntax,
use the variable quot='"' instead of quot="'".
If this is not the problem, you could email me a portion of the file and the
actual portion of your syntax and I will find a solution.
Regards
Raynald Levesque rlevesque@videotron.ca
Visit my SPSS Pages http://pages.infinit.net/rlevesqu/index.htm
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Staffan Lindberg
Sent: March 18, 2002 8:14 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: SV: Can Raynald or anybody help ?
Thank you Raynald and Bjarte for your input. Redefining LAB2 to (A60), I got
the closing quote when looking at TEMP.SPS. However, the concluding period
is missing for each Add Value Labels-line and the result only show labels up
to 9 characters in the Variable View. This also holds true for Raynalds
second solution.
I'm beginning to suspect the Write Outfile-line with its 2 periods at the
end. Could they complicate things ? The TEMP.SPS-file now contains all the
correct labels but misses the concluding period. Can it be that absence of
the period truncates the labels or some such thing ?
thanks and all the best
Staffan Lindberg
National Institute of Public Health
Sweden
-----Ursprungligt meddelande-----
Från: Raynald Levesque [mailto:rlevesque@videotron.ca]
Skickat: den 16 mars 2002 02:00
Till: SPSSX-L@LISTSERV.UGA.EDU
Ämne: Re: Can Raynald or anybody help ?
Hi
Note that LAB2 is defined as a string of length 17 (A17).
After the Line
COMPUTE LAB2=CONCAT(QUOT,kommun,QUOT).
LAB2 will NOT contain the ending quote if the length of kommun exceed 15.
2 solutions are possible:
1) increase dimension of LAB2 to 60 (this is the max length of a label
accepted by SPSS)
2) use
COMPUTE LAB2=CONCAT(QUOT,SUBSTR(LTRIM(kommun),1,15),QUOT).
Let me know if this does not solve it.
Regards
Raynald Levesque rlevesque@videotron.ca
Visit my SPSS Pages http://pages.infinit.net/rlevesqu/index.htm
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Staffan Lindberg
Sent: March 15, 2002 8:47 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Can Raynald or anybody help ?
Hi !
I am applying Raynalds syntax "Apply lab1 as value label to var1 by
syntax.sps" to two variables of mine, county code and county name. The
syntax runs but the value labels only contain the first 9 characters of of
the name. Checking the file "temp.sps" shows that the last apostroph for the
labels are missing.
The output shows:
Warning # 208 on line 4551 in column 35. Text: Upplands
>A text string is not correctly enclosed in quotation marks on the command
>line. Literals may not be continued across command lines without the use
>of the continuation symbol '+'.
My syntax (pinched from Raynald of course) is:
GET FILE='C:\SLASK\KOMMUNTOT1.SAV'.
AGGREGATE /OUTFILE=* /BREAK=kkod /kommun = FIRST(kommun) .
STRING QUOT(A1).
COMPUTE QUOT="'".
STRING LAB2 (A17).
COMPUTE LAB2=CONCAT(QUOT,kommun,QUOT).
WRITE OUTFILE 'C:\SLASK\TEMP.SPS' /"ADD VALUE LABELS kkod " kkod " " lab2
".".
EXECUTE.
GET FILE='c:\slask\kommuntot1.sav'.
INCLUDE 'TEMP.SPS'.
I've compared this syntax with Raynalds numerous times but can't see any
significant difference. Probably I can't see the wood because of too many
trees. Can Raynald or anybody help ?
best
Staffan Lindberg
National Institute of Public Health
Sweden