LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 13 Jun 2008 07:46:45 -0400
Reply-To:     Muthia Kachirayan <muthia.kachirayan@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Muthia Kachirayan <muthia.kachirayan@GMAIL.COM>
Subject:      Re: Keep records with a specific number of digits
In-Reply-To:  <f9b7f0c6-c251-44ff-9fa9-34dc838e7c7d@26g2000hsk.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Jun 13, 2008 at 7:17 AM, <ledaniels7@gmail.com> wrote:

> What if they are not all numeric? Some have a mix with characters as > well...

Then you treat as character variable. Take 4 positions. See example. Y is declared as a string of 4 characters. The assignment Y = X retains first 4 non-blank characters. Note FIRST 4.

data have; input x $; cards; 1234 2345 87 654 78 ; run; data have1; length y $4; set have; y = x; run; proc print data = have1; run; proc contents data = have1; run;


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