|
Andrew:
IMHO, the fastest way of doing this would be (and I think this
would be version-independent):
data test;
input ptid $6.;
pid=input(ptid,6.);
cards;
000012
020093
004000
;
proc print;
run;
Thanks and regards
_________________________
Kumar Sridhar
Sr.Statistical Programmer
Medarex Inc.
Bloomsbury NJ
(908)479-2622
_________________________
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Andrew Kramer
Sent: Thursday, July 06, 2006 4:56 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: [BULK] Strip leading zeros
Importance: Low
I inherited a file that has an undesirable format for the patient ID
("PTID"). In essence PTID was derived from a numeric variable and
reformatted as $6. Unfortunately leading zeros were added to fill out
the
variable. I would like to strip away the leading zeros and leave the
rest
of the value. Here's some examples of what I'd like to do:
PTID newPTID
000012 12
020093 20093
004000 4000
I'm using version 9.1.3.
Thanks,
Andrew Kramer
|