BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
xoxozav_1
Calcite | Level 5

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;

 

 

sas calyear.pngAnd this code does not generate and output table
Could you help me know what the problem is?

 

The log page says:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 data sexactivity;
74 input male female year calyear;
75 datalines;
 
NOTE: Invalid data for male in line 76 1-16.
NOTE: Invalid data for female in line 77 1-16.
NOTE: Invalid data for year in line 78 1-16.
NOTE: Invalid data for calyear in line 79 1-16.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
 
79 CHAR 0.58.0.51.7.1997
ZONE 32330323303033332222222222222222222222222222222222222222222222222222222222222222
NUMR 0E5890E5197919970000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
male=. female=. year=. calyear=. _ERROR_=1 _N_=1
NOTE: Invalid data for male in line 80 1-16.
NOTE: Invalid data for female in line 81 1-17.
NOTE: Invalid data for year in line 82 1-17.
NOTE: Invalid data for calyear in line 83 1-17.
 
83 CHAR 0.55.0.5..15.2005
ZONE 32330323003303333222222222222222222222222222222222222222222222222222222222222222
NUMR 0E5590E5991592005000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
male=. female=. year=. calyear=. _ERROR_=1 _N_=2
NOTE: Invalid data for male in line 84 1-17.
NOTE: Invalid data for female in line 85 1-17.
NOTE: Invalid data for year in line 86 1-17.
NOTE: Invalid data for calyear in line 87 1-17.
 
87 CHAR 0.52.0.47.23.2013
ZONE 32330323303303333222222222222222222222222222222222222222222222222222222222222222
NUMR 0E5290E4792392013000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
male=. female=. year=. calyear=. _ERROR_=1 _N_=3
NOTE: Invalid data for male in line 88 1-17.
NOTE: Invalid data for female in line 89 1-17.
NOTE: LOST CARD.
90 ;
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
male=. female=. year=. calyear=. _ERROR_=1 _N_=4
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.SEXACTIVITY has 3 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
 
90 ;
91 run;
92
93 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
105

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
ghosh
Barite | Level 11

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;

 Capture.JPG

View solution in original post

2 REPLIES 2
ghosh
Barite | Level 11

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;

 Capture.JPG

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2140 views
  • 1 like
  • 3 in conversation