Date: Fri, 15 Feb 2008 14:40:10 -0500
Reply-To: Randall Powers <powers_r@BLS.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Randall Powers <powers_r@BLS.GOV>
Subject: Adding leading zeroes to a variable
Hi,
I have variable i, and wish to convert it into variable APP.
i APP
1 0001
2 0002
3 0003
4 0004
5 0005
6 0006
7 0007
8 0008
9 0009
10 0010
etc.
I don't suspect that i would get any higher than two digits. How would I do
this?
Also, i is generated by this code:
Data ppi.test1b (drop=sfint);
set ppi.test1a;
do i = 1 to sfint;
output;
end;
run;
Thus, I suspect i to be numeric (am I correct?)
When I have variable APP I plan to concatenate it to variable EST to give
me variable ITE.
Thus:
ITE=EST||APP;
Is there a mismatch of variable type? (EST had observations which are
number/letter combinations, so presumably are character strings) If so, how
do I fix the mismatch?
Thanks!