Date: Fri, 28 Nov 2008 09:36:46 -0500
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: What is Logic of doing something like this
In-Reply-To: <c2192a610811271340r7871e2a9o7ab9ec803359ddc8@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii
> if a and not b then output main;
> else if b and not a then output main;
this is xor(a,b)
if ( a and not b)
or(not a and b) then ...;
the sas function is bxor: bitwise xor
see also: band: bitwise and
if bxor(a,b) then ...;
Ron Fehd the band(logic
,macro) maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of SAS_learner
> Sent: Thursday, November 27, 2008 4:41 PM
> To: SAS(r) Discussion
> Subject: What is Logic of doing something like this
>
> Hello all,
> I came around a code something like this, I did not quite
> understand why the
> author is doing something like below
>
> data main oth ;
> merge aa1(in=a) bb1(in=b);
> by sbjnbr pt ;
> if a and not b then output main;
> else if b and not a then output main;
> if a and b then do;
> if a then output main;
> if b then output oth;
> end;
> run;
>
> if a and not b then output main ;
> Else If b and not a then Output Main ; <-- Did not get why ??
>
> and later he goes on
>
> If A and B then do ;
> if a then output main; <-- Again sending it to Main data set ??
> if b then output oth; <-- I did not this logic is this something
> saying If b not a ??
> end;
>
>
|