BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sa2
Calcite | Level 5 Sa2
Calcite | Level 5
 
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
1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

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

7 REPLIES 7
Imroze
Fluorite | Level 6

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

Sa2
Calcite | Level 5 Sa2
Calcite | Level 5
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.
Imroze
Fluorite | Level 6

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.

Sa2
Calcite | Level 5 Sa2
Calcite | Level 5

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;

Astounding
PROC Star

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.

Sa2
Calcite | Level 5 Sa2
Calcite | Level 5
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.
Astounding
PROC Star

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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