Date: Mon, 4 May 2009 08:32:53 -0400
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Art Kendall <Art@DrKendall.org>
Organization: Social Research Consultants
Subject: Re: Remove values in several hundred consecutive varaibles
Content-type: text/plain; charset=ISO-8859-1; format=flowed
It is poor programming to have $sysmis on the right hand side of a command.
One of the strengths of SPSS is the distinction between user missing and
system missing. If you preserve this distinction it can be a great help
to you as you go through the drafts of your application. System missing
values should only appear when the program is unable to do what you tell
it and the missing value is assigned by the system.
Examples are when the data cannot be read as you instruct in the format
Examples are: 'd/k' is not a valid number. The program cannot divide by
zero, nor can it find the sum of a valid number and a missing number., etc.
When the user tells the program to treat a value as missing that means
the value is "user missing". These are given value labels that are
outside the valid range of responses.
value labels item01 to item 10
1 'strongly disagree'
5 'strongly agree'
-1 'interviewer forgot to ask'
-2 'refused to answer'
-3 'respondent said not applicable'
-4 'form mangled in mail unreadable'
-5 'legitimate skip'.
missing values item01 to item10 (lo thru -1).
Open a new instance of SPSS. Copy the syntax below to a syntax file.
Click <run>. Click <all>.
Is this what you are looking for?
data list list /id (f3) comp (f1) q1 (f4) something(f4) d7 (f4).
1 1 1 1 1
2 1 2 2 2
3 2 1 1 1
4 2 2 2 2
do if comp ne 1.
do repeat clear = Q1 to D7.
compute clear = -999.
missing values q1 to d7(lo thru -1).
add value labels q1 to d7 -999 'whatever reason'.
Social Research Consultants
Jim Arnold wrote:
> Hello List,
> I am attempting to delete the values in a consecutive series of
> variables (several thousand of them) using the following syntax:
> do if comp ne 1.
> do repeat clear = Q1 to D7.
> compute clear = $sysmis.
> end repeat.
> end if.
> I am rather new with SPSS syntax so I'm guessing there's something
> very fundamental at work here that's causing the problem. The above
> code runs but it does not do as I need. Values are not cleared from
> the variables from Q1 to D7. What am I missing here?
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
For a list of commands to manage subscriptions, send the command