Hi, I have to add a numeric variable to an existing dataset. I then used this code :
data WANT;
set HAVE;
put INDIC_2009 8.;
format INDIC_2009 comma8.2;
datalines;
38,64
.
.
.
-18,36
0,36
0,36
-88,96
0,12
-88,96
-53,66
0,2
-21,344
2
3
-88,96
-88,96
-18,36
-88,96
0,12
-53,66
0,12
0,12
0,36
0,36
0,36
-107,32
0,6
-106,72
;
run;
But it does not work. I only get "."
Any idea ?
Thank you !
Look at the data set HAVE. Is the variable INDIC_2009 character or numeric? Are there errors or warnings in the LOG?
I added an INFILE and an INPUT statement to your Data step, and it seems to be working. See code, below, and see results, below the code. I also changed the commas to decimal points, but I am based in the US, so a comma may be valid where you are.
data WANT;
set HAVE;
* put INDIC_2009 8.;
format INDIC_2009 comma8.2;
INFILE Datalines;
INPUT INDIC_2009;
Jim
Results:
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.