Learning SAS? Welcome to the exclusive online community for all SAS learners.

Inputting Raw Data into SAS U

Reply
New Contributor
Posts: 4

Inputting Raw Data into SAS U

[ Edited ]

Hi, 

 

Tried entering the following code, 

 

data new;
input Precha Postcha;
cards;
73 65
80 90
78 88
70 75
70 75
73 78
75 68
63 50
100 73
58 45
;
proc print;

run;

 

and am getting the following error, 

 

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 data new;
57 input Precha Postcha @@;
58 cards;
 
NOTE: Invalid data for Precha in line 59 1-5.
NOTE: Invalid data for Postcha in line 60 1-5.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
 
60 CHAR 80.90
ZONE 33033222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 80990000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
Precha=. Postcha=. _ERROR_=1 _N_=1
NOTE: Invalid data for Precha in line 61 1-5.
NOTE: Invalid data for Postcha in line 62 1-5.
 
62 CHAR 70.75
ZONE 33033222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 70975000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
Precha=. Postcha=. _ERROR_=1 _N_=2
NOTE: Invalid data for Precha in line 63 1-5.
NOTE: Invalid data for Postcha in line 64 1-5.
 
64 CHAR 73.78
ZONE 33033222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 73978000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
Precha=. Postcha=. _ERROR_=1 _N_=3
NOTE: Invalid data for Precha in line 65 1-5.
NOTE: Invalid data for Postcha in line 66 1-5.
 
66 CHAR 63.50
ZONE 33033222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 63950000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
Precha=. Postcha=. _ERROR_=1 _N_=4
NOTE: Invalid data for Precha in line 67 1-6.
NOTE: Invalid data for Postcha in line 68 1-5.
 
68 CHAR 58.45
ZONE 33033222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 58945000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
Precha=. Postcha=. _ERROR_=1 _N_=5
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.NEW has 5 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds
 
69 ;
 
70 proc print;
71 run;
 
NOTE: There were 5 observations read from the data set WORK.NEW.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.14 seconds
cpu time 0.14 seconds
 
 
72 *
73 proc ttest;
74 paired Precha*Postcha;
______
180
 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
75 run;
76
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
90
Super User
Posts: 11,343

Re: Inputting Raw Data into SAS U

Your log shows you used

input Precha Postcha @@;

not

input Precha Postcha;

 

The @@ has behavior for not advancing the row pointer and would not be needed with the data you show.

 

Ask a Question
Discussion stats
  • 1 reply
  • 574 views
  • 1 like
  • 2 in conversation