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 (July 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 23 Jul 2004 08:58:32 -0500
Reply-To:     Walter Scott <Walter.Scott@STATE.TN.US>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Walter Scott <Walter.Scott@STATE.TN.US>
Subject:      Re: Position in a String
Comments: To: sas_user2000@YAHOO.COM
Content-Type: text/plain; charset=US-ASCII

You can try: if input(badnum,3.0)=9; /* assumes badnum is a char var w/ length <=3;" */ or if input(left(badnum),3.0)=9; /* assumes badnum is a char var of any length */

>>> x x <sas_user2000@YAHOO.COM> 04:10:37 23-Jul-04 >>> Hi all,

I am a newbie with 8.2 on WIN platform.

I have a dataset with a field which is or should be a 4 digit number entered as a character. Due to data entry error the field may have 1, 2, or 3 digits and in any position. ie "9 " or " 9 " or " 9 " or " 9". I do have a list of those numbers and i need to know what record they belong to but not knowing in what position the number or numbers may be I was wondering if there is a simpeler method that can look for the number or numbers any of the 4 positions in the field?

I have been using the following for each position which is time consuming. Is there an easier way?

data temp; set numberslist; if badnum ="9 " or badnum = " 9 " or badnum=" 9 " or badnum= " 9"; run;

Cheers

__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail


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