Date: Sat, 3 Nov 2001 09:32:00 -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: alternative syntax for editing string variables
In-Reply-To: <5.1.0.14.0.20011103160531.00a38d60@mail.dyson.brisnet.org.au>
Content-Type: text/plain; charset="us-ascii"
Hi
String variables must be defined before they can be used, add the following
line before the current syntax.
STRING worst1 worst2 (A8).
where 8 is the lenght of the string variable. Replace 8 by the same length
as the length of badest1 adn badest2.
If the variable scene is also a string (of length 1) then you need to use
do if scene="1".
if the variable scene is also a string (of length > 1) then you could to use
do if RTRIM(LTRIM(scene))="1".
and
do if RTRIM(LTRIM(scene))="2".
to cover the possibilities that there are blanks before or after the 1 or
the 2.
HTH
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
Bob Green
Sent: Saturday, November 03, 2001 3:59 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: alternative syntax for editing string variables
I have been using the following syntax to edit a large file. These commands
only work with numeric data. I would appreciate any advice regarding syntax
to perform this function using string variables.
Bob
do if scene=1.
compute worst1=badest1.
compute worst2=badest2.
end if.
do if scene=2.
compute worst2=badest1.
compute worst1=badest2.
end if.