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 (January 2008)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 29 Jan 2008 19:21:56 -0500
Reply-To:     Raynald Levesque <raynald.levesque@GMAIL.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Raynald Levesque <raynald.levesque@GMAIL.COM>
Subject:      Re: Macro or Loop to minimize Syntax
Comments: To: Juan Pablo Sandoval <jpsandoval4275@gmail.com>
In-Reply-To:  <553a11e90801291504v43032263l509ed7f14a4817f9@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Assuming variables var0010 var0020 ... var0750 are consecutive in the data file and v0017 v0027 ... v0757 are consecutive in the data file.

The command COMPUTE clean=ANY(1,var0010 TO var0750) AND ANY(2,v0017 TO v0757). does the job.

HTH

-- Raynald Levesque www.spsstools.net

On Jan 29, 2008 6:04 PM, Juan Pablo Sandoval <jpsandoval4275@gmail.com> wrote:

> Hi: > > I'm running a validation syntax such as this: > > if (var0010 = 1 and v0017 = 2) clean = 1. > if (var0020 = 1 and v0027 = 2) clean = 1. > if (var0040 = 1 and v0047 = 2) clean = 1. > if (var0050 = 1 and v0057 = 2) clean = 1. > ... > ... > ... > if (var0750 = 1 and v0757 = 2) clean = 1. > > As you can see it's a fairly long syntax, and as you can see var0010 > increases by 10 every step for 75 steps until reaching var0750. I don't > know > if there is some kind of syntax doing a loop of some kind to save space > and > get the same results. > > Regards. > > ===================== > 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


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