|
From: | Alan Mead |
Subject: | Re: Create new variables from others (If Condistional or recode) |
Date: | Fri, 27 Oct 2017 12:00:15 -0500 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
Sorry, I forgot to add "END IF." Here's where it would go: DO IF(P5=2 or P6=2 or P7=2). COMPUTE Var0001 = 1. ELSE IF (P8=1). COMPUTE Var0001 = 2. ELSE. COMPUTE Var0001 = 3 END IF. EXECUTE. On 10/27/2017 11:52 AM, Alan Mead
wrote:
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. -- 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] |