Hello all, I've been struggling with this one for a couple days now so I am forced to ask for help (which I usually try not to do without attempting many things myself). I have an excel file containing numeric variables 24 columns across and 365 rows down. The column headers are yvar1, yvar2, yvar3......yvar24. EX. yvar1 yvar2 yvar3........ yvar24 9999.99 999.00 888.12 7777.34 So import into SAS. I need to keep 2 implied decimal places and then have every column be the same length. For example I need yvar1 to be 999999 instead of 9999.99 and yvar2 would need to padded with a leading zero to show 099900. Yvar3 would be 088812 and yvar24 would be 777734. I've used the compress function to remove the decimal point and add the implied decimal places using the following code : data compression; set work.usage; char1=compress(put(yvar1,10.2),'.'); char2=compress(put(yvar1,10.2),'.'); char3=compress(put(yvar1,10.2),'.'); char4=compress(put(yvar1,10.2),'.'); run; This works well for keeping the 2 implied decimal places and removing the decimal point. However, I cannot get the variables to pad with leading zeros where necessary. I've tried using the $z format to do it to no avail. I tried something like: data helpme; set compression; newchar = put (input(char1,10.2),$z8.) run; That code somehow removes my implied decimal points. What the heck am I doing wrong? THANK YOU.
... View more