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 (August 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 8 Aug 2005 11:23:30 -0400
Reply-To:     Xu Libin <Libin.Xu@IRS.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Xu Libin <Libin.Xu@IRS.GOV>
Subject:      Is the Select Statement Correct?

Dear Sas listers,

Can anyone there tell me what is wrong with the following syntax? There must be an logic error because the freq analysis gives three categories -- 0, 3, and 99 and the actual number of categories should be 14.

Select(amt); When (amt <= -5000) amtN=0; When (amt > -4999 and (amt <= -2500)) amtN=1; When (amt > -2499 and (amt <= -1)) amtN=2; When (amt > 0 and (amt <= 9999)) amtN=3; When (amt > 9999 and (amt <= 24999)) amtN=4; When (amt > 24999 and (amt <= 39999)) amtN=5; When (amt > 39999 and (amt <= 59999)) amtN=6; When (amt > 59999 and (amt <= 74999)) amtN=7; When (amt > 74999 and (amt <= 99999)) amtN=8; When (amt > 99999 and (amt <= 124999)) amtN=9; When (amt > 124999 and (amt <= 149999)) amtN=10; When (amt > 149999 and (amt <= 174999)) amtN=11; When (amt > 174999 and (amt <=199999)) amtN=12; When (amt > 199999) amtN=13; Otherwise amtN=99; end;

Thank you for your advice.

Libin


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