Date: Thu, 29 May 2008 12:29:06 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: Array documentation
hi ... another approach ... I think this'll work regardless of the content of the variables ...
* some data similar to yours;
input (cdcla001-cdcla005) (: $5.);
NSF OTHER OTHER OTHER OTHER
OTHER OTHER OTHER OTHER OTHER
OTHER NSA OTHER NSF OTHER
OTHER OTHER OTHER OTHER NSA
* look for a word in a concatenated character string;
clnsa = (indexw(catx(' ',of cdcla:),'NSA') gt 0);
clnsf = (indexw(catx(' ',of cdcla:),'NSF') gt 0);
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
> thanks for your help.
> how can I use ARRAY with this :
> DATA RESN.CNTNAUT4;
> SET RESN.CNTNAUT3;
> IF CDCLA001 = 'NSA' OR CDCLA002 = 'NSA'
> OR CDCLA003 = 'NSA' OR CDCLA004 = 'NSA'
> OR CDCLA005 = 'NSA' OR CDCLA006 = 'NSA'
> OR CDCLA007 = 'NSA' OR CDCLA008 = 'NSA'
> OR CDCLA009 = 'NSA' OR CDCLA010 = 'NSA'
> OR CDCLA011 = 'NSA' OR CDCLA012 = 'NSA'
> OR CDCLA013 = 'NSA' OR CDCLA014 = 'NSA'
> OR CDCLA015 = 'NSA' OR CDCLA016 = 'NSA'
> OR CDCLA017 = 'NSA' OR CDCLA018 = 'NSA'
> OR CDCLA019 = 'NSA' OR CDCLA020 = 'NSA'
> THEN CLNSA = 1; ELSE CLNSA = 0;
> IF CDCLA001 = 'NSF' OR CDCLA002 = 'NSF'
> OR CDCLA003 = 'NSF' OR CDCLA004 = 'NSF'
> OR CDCLA005 = 'NSF' OR CDCLA006 = 'NSF'
> OR CDCLA007 = 'NSF' OR CDCLA008 = 'NSF'
> OR CDCLA009 = 'NSF' OR CDCLA010 = 'NSF'
> OR CDCLA011 = 'NSF' OR CDCLA012 = 'NSF'
> OR CDCLA013 = 'NSF' OR CDCLA014 = 'NSF'
> OR CDCLA015 = 'NSF' OR CDCLA016 = 'NSF'
> OR CDCLA017 = 'NSF' OR CDCLA018 = 'NSF'
> OR CDCLA019 = 'NSF' OR CDCLA020 = 'NSF'
> THEN CLNSF = 1; ELSE CLNSF = 0;