Prev: Appending info to the end of a variable
Next: boxplot
From: Sdlentertd on 15 Jul 2010 19:08 I have a field that turns into exponential notaion instead of a character field. Field Name is Rnumber (rnumber_raw) data out1; set have; format Rnumber $7.; Rnumber = put(input(rnumber_raw,12.0),z7.); so in the dataset "have" the Rnumber_raw is numeric with the value of : 26124425 in Out1 it gets converted into '2.612E7' WHY? i have 10 Rnumber fields and i am using the exact same way to convert them and only one out of 10 shows up as exponential notation.
From: Reeza on 15 Jul 2010 19:57 On Jul 15, 4:08 pm, Sdlentertd <sdlente...(a)gmail.com> wrote: > I have a field that turns into exponential notaion instead of a > character field. Field Name is Rnumber (rnumber_raw) > > data out1; > set have; > format Rnumber $7.; > Rnumber = put(input(rnumber_raw,12.0),z7.); > > so in the dataset "have" the Rnumber_raw is numeric with the value > of : 26124425 > in Out1 it gets converted into '2.612E7' WHY? > > i have 10 Rnumber fields and i am using the exact same way to convert > them and only one out of 10 shows up as exponential notation. The number has 8 characters and you're specifying $7. Change it to 8 and it works fine. 14 data out1; 15 format Rnumber $8.; 16 rnumber_raw='26124425'; 17 Rnumber = put(input(rnumber_raw,12.0),z8.); 18 run; NOTE: The data set WORK.OUT1 has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 19 data out1; 20 format Rnumber $7.; 21 rnumber_raw='26124425'; 22 Rnumber = put(input(rnumber_raw,12.0),z7.); 23 run; NOTE: The data set WORK.OUT1 has 1 observations and 2 variables. NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST" format. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
|
Pages: 1 Prev: Appending info to the end of a variable Next: boxplot |