Date: Fri, 1 May 2009 16:08:51 -0500
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: Boolean Condition for a series of variables
Content-Type: text/plain; charset=ISO-8859-1
You need the OF operator, and the MISSING function; however you cannot
really do exactly what you want there, as (at least in my tests)
IF MISSING(OF X1-X5)
does not work.
You can use the following example:
call missing(of x1-x5);
if missing(sum(of x1-x5)) then xm_all=1;
if nmiss(of x1-x5) > 0 then xm_any = 1;
The nmiss line is probably what you want.
On Fri, May 1, 2009 at 3:46 PM, Scott Murff <firstname.lastname@example.org> wrote:
> Is it possible to use conditional logic on a series of variables? For
> example I have a series of variables with names fcfe1, fcfe2, ..., fcfe20.
> I want to conditionally execute statements if all of these variables are
> I thought something like this would work.
> if fcfe1-fcfe20 ne . then do;
> sas statements;
> In this context SAS interprets fcfe1-fcfe20 as subtraction instead of a
> series of var names. I am looking for a short cut from having to list out
> all 20 variable names.