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 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 19 Dec 2006 22:30:12 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: What's wrong with my code?
Comments: To: sophiDT@hotmail.com
In-Reply-To:  <200612192217.kBJHcWrL015617@malibu.cc.uga.edu>
Content-Type: text/plain; format=flowed

Assuming yoru business logic is correct you may be better served by doing this if your business logic isnt correct then perhaps this recoded example may better help you find the mistake.:

IF RACE IN ( 4 5 ) THEN IMPETHN = 4 ; ELSE IF RACE IN ( 95 ) THEN IMPETHN = 5 ; ELSE IF RACE IN ( 97 98 ) THEN IMPETHN = RACEETHA ; ELSE IMPETHN = RACE ;

IF RACE IN ( 97 98 ) THEN IMPETHN_FLG = 1 ;

Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you walk funny. ~Kathryn Carpenter

From: Sophia Tong <sophiDT@HOTMAIL.COM> Reply-To: Sophia Tong <sophiDT@HOTMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: What's wrong with my code? Date: Tue, 19 Dec 2006 17:17:28 -0500

Dear SAS-L experts,

I am lost with this code and couldn't figure out what's wrong. Here is my code: IF RACE IN (4, 5) THEN IMPETHN=4; ELSE IF RACE=95 THEN IMPETHN=5; ELSE IF RACE IN (97, 98) THEN DO; IMPETHN=RACEETHA; IMPETHN_FLG=1; END; ELSE IMPETHN=RACE;

The results is a totally mess: People who currently smoke PIPE, BY REGION 211 13:53 Tuesday, December 19, 2006

The FREQ Procedure

Cumulative Cumulative IMPETHN RACE RACEETHA IMPETHN_FLG Frequency Percent Frequency Percent ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 1 1 1 . 1261 10.29 1261 10.29 1 1 1 1 2 0.02 1263 10.30 1 2 2 . 16 0.13 1279 10.43 1 6 2 . 2 0.02 1281 10.45 1 95 2 . 2 0.02 1283 10.47 1 97 1 1 7 0.06 1290 10.52 1 98 1 1 1 0.01 1291 10.53 2 1 1 . 16 0.13 1307 10.66 2 2 2 . 9910 80.85 11217 91.52 2 2 2 1 8 0.07 11225 91.58 2 4 2 . 1 0.01 11226 91.59 2 5 2 . 3 0.02 11229 91.61 2 6 2 . 10 0.08 11239 91.69 2 6 2 1 1 0.01 11240 91.70 2 95 2 . 24 0.20 11264 91.90 2 95 2 1 1 0.01 11265 91.91 2 97 2 1 36 0.29 11301 92.20 2 98 2 1 4 0.03 11305 92.23 3 1 1 . 1 0.01 11306 92.24 3 2 2 . 3 0.02 11309 92.27 3 3 3 . 578 4.72 11887 96.98 3 95 2 . 3 0.02 11890 97.01 3 97 3 1 3 0.02 11893 97.03 4 1 1 . 1 0.01 11894 97.04 4 2 2 . 1 0.01 11895 97.05 4 4 2 . 86 0.70 11981 97.75 4 5 2 . 12 0.10 11993 97.85 4 95 2 . 2 0.02 11995 97.86 5 1 1 . 1 0.01 11996 97.87 5 2 2 . 15 0.12 12011 97.99 5 3 3 . 1 0.01 12012 98.00 5 6 2 . 2 0.02 12014 98.02 5 95 2 . 109 0.89 12123 98.91 6 1 1 . 1 0.01 12124 98.91 6 2 2 . 7 0.06 12131 98.97 6 4 2 . 1 0.01 12132 98.98 6 5 2 . 1 0.01 12133 98.99 6 6 2 . 121 0.99 12254 99.98 6 95 2 . 3 0.02 12257 100.00

Sorry for the output, you can copy and past this part in word to see better.

Thanks,

Suhong

_________________________________________________________________ Your Hotmail address already works to sign into Windows Live Messenger! Get it now http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get.live.com/messenger/overview


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