|
From: | Alan Mead |
Subject: | Re: Create new variables from others (If Condistional or recode) |
Date: | Fri, 27 Oct 2017 11:52:15 -0500 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
You have the syntax wrong. I imagined variable V1. I have no idea
is this accomplishes what you want, it just corrects the syntax to
illustrate how you have the syntax wrong. The spacing before the
RECODE/COMPUTE statements is just to make it easier to read. DO IF(P5=2 or P6=2 or P7=2). RECODE V1 (2=1) INTO Var0001. ELSE IF (P8=1). RECODE P8 (1=2) into Var0001. ELSE. COMPUTE Var0001=3 EXECUTE. Also, I don't think you need to use RECODE: DO IF(P5=2 or P6=2 or P7=2). COMPUTE Var0001 = 1. ELSE IF (P8=1). COMPUTE Var0001 = 2. ELSE. COMPUTE Var0001 = 3 EXECUTE. On 10/27/2017 11:45 AM, Betsabé Cohen
wrote:
-- Alan D. Mead, Ph.D. President, Talent Algorithms Inc. science + technology = better workers http://www.alanmead.org I've... seen things you people wouldn't believe... functions on fire in a copy of Orion. I watched C-Sharp glitter in the dark near a programmable gate. All those moments will be lost in time, like Ruby... on... Rails... Time for Pi. --"The Register" user Alister, applying the famous "Blade Runner" speech to software development |
[Prev in Thread] | Current Thread | [Next in Thread] |