Write and run SAS programs in your web browser

DATA CODING

Accepted Solution Solved
Reply
Occasional Contributor Sa2
Occasional Contributor
Posts: 6
Accepted Solution

DATA CODING

Can anyone kindly run this coding and see where the error is. I am trying and unable to understand whats wrong. thanks

 

Data en;
infile cards dlm="." dsd truncover;
input Fert Day Time Hfert Hfeed pH DO Temp NH4 NO2 TAN PO4 Fishwt;
cards;
1 8 9 23 22.5 7.8 6.7 29 0.43 0.024 0.454 0.1 75
1 8 9 23 22.5 7.9 7.1 29 0.13 0.009 0.139 0.1 59
1 8 9 23 22.5 7.8 6.8 28 0.16 0.012 0.172 0.1 80
0 8 9 23 22.5 7.9 7.4 29 0.57 0.039 0.609 0.14 76
0.5 8 9 23 22.5 8 7.2 28 0.18 0.016 0.196 0.12 82
0 8 9 23 22.5 7.9 7 28 0.74 0.063 0.803 0.14 90
0.5 8 9 23 22.5 7.8 6.7 28 0.93 0.049 0.979 0.15 68
0 8 9 23 22.5 7.9 7.1 28 0.33 0.048 0.378 0.11 98
0.5 8 9 23 22.5 7.9 7 28 0.15 0.009 0.159 0.12 82
;

proc glm;
class fert;
model pH=fert;

proc glm;
class fert;
model DO=fert;

proc glm;
class fert;
model NH4=fert;

proc glm;
class fert;
model NO2=fert;

proc glm;
class fert;
model PO4=fert;

proc glm;
class fert;
model Fishwt=fert;

run;


Accepted Solutions
Solution
‎12-31-2015 11:45 AM
Super User
Posts: 11,105

Re: DATA CODING

[ Edited ]

Post the log content with code you run and the error message. I don't get any errors if I remove the infile statement.

View solution in original post


All Replies
Super User
Posts: 5,353

Re: DATA CODING

dlm="." is incorrect for your data.  It says to expect a decimal point as a delimiter between data values.  You have a space between data values.  

 

Your code should be using dlm=" " instead.

Occasional Contributor Sa2
Occasional Contributor
Posts: 6

Re: DATA CODING

I am doing every suggestion you are saying but I am still getting new error every time. Is it feasible for you to run this data and see where the error is
Solution
‎12-31-2015 11:45 AM
Super User
Posts: 11,105

Re: DATA CODING

[ Edited ]

Post the log content with code you run and the error message. I don't get any errors if I remove the infile statement.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 296 views
  • 1 like
  • 3 in conversation