Date: Mon, 21 Jan 2002 15:47:36 -0500
Reply-To: Francis Harvey <HARVEYF1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Francis Harvey <HARVEYF1@WESTAT.COM>
Subject: Re: leading zeros in a character variable
Content-Type: text/plain; charset="iso-8859-1"
Greetings Nancy,
Here is some sample code in case a numeric conversion is not feasible, HTH:
data _null_;
length a $ 10;
a = "afb";
if length(a) < 10 then a = repeat("0",9 - length(a)) || a;
run;
Francis R. Harvey III
WB303, x3952
harveyf1@westat.com
VB programmers know the wisdom of Nothing
|