LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2002, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 10 Dec 2002 16:02:01 -0500
Reply-To:     "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Subject:      Re: Transform 0(zero) to 1 (one)
Comments: cc: JSHansen <jan@*SELCHAU-HANSEN.DK>
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