Shri, (actually this was an attempt to answer RV's question) I am getting an error with the length-1 third argument and I should. What is even more odd, I am getting single digit hundredths values rather than integers. I guess I have to study the input function :smileyshocked: data have; format f1 f2 $30. f1n 8.2 f2n 8.2 ; input f1 1-11 f2 12-22; f1n=input(substr(f1,1,length(trim(f1))),8.2); f2n=input(substr(f2,1,length(trim(f2))),8.2); cards; 1 229.00 2 39.83 3 38.25 1 346.00 1 55.64 ; run; options nocenter; proc print; run; *Output: f1n values in decimals? Obs f1 f2 f1n f2n 1 1 229.00 0.01 229.00 2 2 39.83 0.02 39.83 3 3 38.25 0.03 38.25 4 1 346.00 0.01 346.00 5 1 55.64 0.01 55.64 ; data have2; format f1 f2 $30. f1n 8.2 f2n 8.2 ; input f1 1-11 f2 12-22; f1n=input(substr(f1,1,length(compress(f1))),best8.); f2n=input(substr(f2,1,length(compress(f2))),best8.); cards; 1 229.00 2 39.83 3 38.25 1 346.00 1 55.64 ; run; options nocenter; proc print; run; *Output: Obs f1 f2 f1n f2n 1 1 229.00 1.00 229.00 2 2 39.83 2.00 39.83 3 3 38.25 3.00 38.25 4 1 346.00 1.00 346.00 5 1 55.64 1.00 55.64 ; Message was edited by: Dorota Jarosz - added (actually this was an attempt to answer RV's question) to the greetings.
... View more