I wrote the following code:
data sexact;
input male female year calyear ;
datalines;
0.63 0.51 1 1991
0.62 0.52 3 1993
0.63 0.57 5 1995
0.58 0.51 7 1997
0.59 0.49 9 1999
0.53 0.46 11 2001
0.56 0.5 13 2003
0.55 0.5 15 2005
0.55 0.5 17 2007
0.53 0.48 19 2009
0.54 0.48 21 2011
0.52 0.47 23 2013
0.45 0.4 25 2015
0.41 0.37 27 2017
;
run;
And this code does not generate and output table
Could you help me know what the problem is?
The log page says:
Perhaps you have tabs instead of spaces.
The following code ran fine after using my editor feature to convert tabs to spaces
data sexact;
input male female year calyear ;
datalines;
0.63 0.51 1 1991
0.62 0.52 3 1993
0.63 0.57 5 1995
0.58 0.51 7 1997
0.59 0.49 9 1999
0.53 0.46 11 2001
0.56 0.5 13 2003
0.55 0.5 15 2005
0.55 0.5 17 2007
0.53 0.48 19 2009
0.54 0.48 21 2011
0.52 0.47 23 2013
0.45 0.4 25 2015
0.41 0.37 27 2017
;
run;
Perhaps you have tabs instead of spaces.
The following code ran fine after using my editor feature to convert tabs to spaces
data sexact;
input male female year calyear ;
datalines;
0.63 0.51 1 1991
0.62 0.52 3 1993
0.63 0.57 5 1995
0.58 0.51 7 1997
0.59 0.49 9 1999
0.53 0.46 11 2001
0.56 0.5 13 2003
0.55 0.5 15 2005
0.55 0.5 17 2007
0.53 0.48 19 2009
0.54 0.48 21 2011
0.52 0.47 23 2013
0.45 0.4 25 2015
0.41 0.37 27 2017
;
run;
The log shows that you have hex 09 (TAB) characters as delimiter. Add this statement:
infile datalines dlm='09'x;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: