Write and run SAS programs in your web browser

Error Message

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

Error Message

 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
I am having the upper mentioned error dont know whats wrong

Accepted Solutions
Solution
‎12-31-2015 09:25 AM
Super User
Posts: 5,372

Re: Error Message

On the INFILE statement, DATACARDS is not a reserved word.  It refers to a data set name (and that data set does not exist).

 

Instead of DATACARDS, you can use either CARDS or DATALINES.

View solution in original post


All Replies
Contributor
Posts: 62

Re: Error Message

If you provide more data then it will be helpful to answer. say give the sample code (how you are using and where--scenario).

Occasional Contributor Sa2
Occasional Contributor
Posts: 6

Re: Error Message

Here is the full statement
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 Data en;
57 input Fert Day Time Hfert Hfeed pH DO Temp NH4 NO2 TAN PO4 Fishwt
58 datalines;
59 1892322.57.86.7290.430.0240.4540.175
_
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
60 1892322.57.97.1290.130.0090.1390.159
61 1892322.57.86.8280.160.0120.1720.180
62 0892322.57.97.4290.570.0390.6090.1476
63 0.5892322.587.2280.180.0160.1960.1282
64 0892322.57.97280.740.0630.8030.1490
65 0.5892322.57.86.7280.930.0490.9790.1568
66 0892322.57.97.1280.330.0480.3780.1198
67 0.5892322.57.97280.150.0090.1590.1282
68 ;
69
 
ERROR: No DATALINES or INFILE statement.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.EN may be incomplete. When this step was stopped there were 0 observations and 14 variables.
WARNING: Data set WORK.EN was not replaced because this step was stopped.
Contributor
Posts: 62

Re: Error Message

still u pasted the log, what I want is a sample code which you are using.

 

Well as per the log you need to provide the infile statement with dlm option .

 

Ex: data test;

        infile datacards dlm="." dsd truncover;

        input  x y z;

        datacards;

        123.123.123

        ;

 

hope answered the question.

Occasional Contributor Sa2
Occasional Contributor
Posts: 6

Re: Error Message

I am sorry I am a really a beginner so could not understand you exactly. Here are the codes

Data en;
infile datacards dlm="." dsd truncover;
input Fert Day Time Hfert Hfeed pH DO Temp NH4 NO2 TAN PO4 Fishwt
datalines;
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;

Super User
Posts: 5,372

Re: Error Message

You will need to add a semicolon at the end of your INPUT statement ... the sort of mistake that everyone has made at one point or another.

Occasional Contributor Sa2
Occasional Contributor
Posts: 6

Re: Error Message

But when I do that it gives following error
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 Data en;
57 infile datacards dlm="." dsd truncover;
58 input Fert Day Time Hfert Hfeed pH DO Temp NH4 NO2 TAN PO4 Fishwt;
59 cards;

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/DATACARDS.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.EN may be incomplete. When this step was stopped there were 0 observations and 13 variables.
WARNING: Data set WORK.EN was not replaced because this step was stopped.
Solution
‎12-31-2015 09:25 AM
Super User
Posts: 5,372

Re: Error Message

On the INFILE statement, DATACARDS is not a reserved word.  It refers to a data set name (and that data set does not exist).

 

Instead of DATACARDS, you can use either CARDS or DATALINES.

🔒 This topic is solved and locked.

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

Discussion stats
  • 7 replies
  • 469 views
  • 0 likes
  • 3 in conversation