```Date: Tue, 10 Dec 2002 16:02:01 -0500 Reply-To: "Fehd, Ronald J. (PHPPO)" Sender: "SAS(r) Discussion" From: "Fehd, Ronald J. (PHPPO)" Subject: Re: Transform 0(zero) to 1 (one) Comments: cc: JSHansen Content-Type: text/plain > From: JSHansen [mailto:jan@*SELCHAU-HANSEN.DK] > Is there a simple function to > transform a 0 (zero) to 1 (one), > and all other figures to 0 (zero). > It is to test for the truthness of a statement. (boolean). data x; One = 1; Zero = 0; notOne = not(One); notZero = not(Zero); Two = 2; Three = 3; array Booze (*) One Two Three Zero NotOne NotZero; array Flipt (6) ; drop I; do I = 1 to dim(Booze);Flipt(I) = (Booze(I) eq 0); put Booze(I)= Flipt(I)=; end; stop; RUN; ONE =1 FLIPT1=0 TWO =2 FLIPT2=0 THREE =3 FLIPT3=0 ZERO =0 FLIPT4=1 NOTONE =0 FLIPT5=1 NOTZERO=1 FLIPT6=0 Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov By using your intelligence you can sometimes make your problems twice as complicated. -- Ashleigh Brilliant "Nothing is particularly hard if you divide it into small jobs." - Henry Ford, Industrialist ```

Back to: Top of message | Previous page | Main SAS-L page