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

 

After about 700 lines of analysis code, below is the spot that i am getting error messages. I looked but
could not find an absent 'run;" or absent ";".
In this nutritional epidemiology data code with SAS 9.4 and SAS Studio, what might be the problem?
Thanks.
David Cundiff

data source6;
set source5;
*total_mean=&total_mean.;

data IHME2017.source;
set source6;
run; quit;
/*Males final LDLc formula components*/

LDLc17mf1s=

ERROR 180: Statement is not valid or it is used out of proper order.

pmeat17KCLDLs*0.0027261
+rmeat17KCLDLs*0.0390959
+fish17KCLDLs*0.0020772
+milk17KCLDLs*0.0136106
+poultry16KCLDLs*0.0214094
+eggs16KCLDLs *0.0114435
;

*Worldwide plant foods with positive corr with LDLc;
LDLc17mf2s=
ERROR 180: Statement is not valid or it is used out of proper order.
ALCOHOL17MKCLDLs *0.0247706
+sugar17mKCLDLs *0.0501347
+fruits17KCLDLs*0.0152342
+vegetables17KCLDLs *0.0358683
+nutsseeds17KCLDLs *0.0027299;
*Negative corr with LDLc only;
LDL17mf3s=
ERROR 180: Statement is not valid or it is used out of proper order.
- wgrains17KCLDLs *0.0063658
-corn17KCLDLs*0.0224283
-rice17KCLDLs*0.0086221
-legumes17KCLDLs *0.0347094
-potatoes17KCLDL*0.0071434
-swtpot16KCLDLs *0.0044873
;
run; quit;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@dkcundiffMD wrote:

 

After about 700 lines of analysis code, below is the spot that i am getting error messages. I looked but
could not find an absent 'run;" or absent ";".
In this nutritional epidemiology data code with SAS 9.4 and SAS Studio, what might be the problem?
Thanks.
David Cundiff

data source6;
set source5;
*total_mean=&total_mean.;

data IHME2017.source;
set source6;
run; quit;
/*Males final LDLc formula components*/

LDLc17mf1s=

ERROR 180: Statement is not valid or it is used out of proper order.

pmeat17KCLDLs*0.0027261
+rmeat17KCLDLs*0.0390959
+fish17KCLDLs*0.0020772
+milk17KCLDLs*0.0136106
+poultry16KCLDLs*0.0214094
+eggs16KCLDLs *0.0114435
;

*Worldwide plant foods with positive corr with LDLc;
LDLc17mf2s=
ERROR 180: Statement is not valid or it is used out of proper order.
ALCOHOL17MKCLDLs *0.0247706
+sugar17mKCLDLs *0.0501347
+fruits17KCLDLs*0.0152342
+vegetables17KCLDLs *0.0358683
+nutsseeds17KCLDLs *0.0027299;
*Negative corr with LDLc only;
LDL17mf3s=
ERROR 180: Statement is not valid or it is used out of proper order.
- wgrains17KCLDLs *0.0063658
-corn17KCLDLs*0.0224283
-rice17KCLDLs*0.0086221
-legumes17KCLDLs *0.0347094
-potatoes17KCLDL*0.0071434
-swtpot16KCLDLs *0.0044873
;
run; quit;

 


Easy fix: remove the highlighted text.

 

Quit has nothing to do with data steps. Doesn't throw any errors but not needed.

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

The formula to create LDLc17mf1s= is not in a data step, and it's not allowed anywhere else in SAS.

--
Paige Miller
ballardw
Super User

@dkcundiffMD wrote:

 

After about 700 lines of analysis code, below is the spot that i am getting error messages. I looked but
could not find an absent 'run;" or absent ";".
In this nutritional epidemiology data code with SAS 9.4 and SAS Studio, what might be the problem?
Thanks.
David Cundiff

data source6;
set source5;
*total_mean=&total_mean.;

data IHME2017.source;
set source6;
run; quit;
/*Males final LDLc formula components*/

LDLc17mf1s=

ERROR 180: Statement is not valid or it is used out of proper order.

pmeat17KCLDLs*0.0027261
+rmeat17KCLDLs*0.0390959
+fish17KCLDLs*0.0020772
+milk17KCLDLs*0.0136106
+poultry16KCLDLs*0.0214094
+eggs16KCLDLs *0.0114435
;

*Worldwide plant foods with positive corr with LDLc;
LDLc17mf2s=
ERROR 180: Statement is not valid or it is used out of proper order.
ALCOHOL17MKCLDLs *0.0247706
+sugar17mKCLDLs *0.0501347
+fruits17KCLDLs*0.0152342
+vegetables17KCLDLs *0.0358683
+nutsseeds17KCLDLs *0.0027299;
*Negative corr with LDLc only;
LDL17mf3s=
ERROR 180: Statement is not valid or it is used out of proper order.
- wgrains17KCLDLs *0.0063658
-corn17KCLDLs*0.0224283
-rice17KCLDLs*0.0086221
-legumes17KCLDLs *0.0347094
-potatoes17KCLDL*0.0071434
-swtpot16KCLDLs *0.0044873
;
run; quit;

 


Easy fix: remove the highlighted text.

 

Quit has nothing to do with data steps. Doesn't throw any errors but not needed.

dkcundiffMD
Quartz | Level 8

You were right Dr. Miller!... An easy fix. 

Thanks. 

David Cundiff

 

dkcundiffMD
Quartz | Level 8

Getting rid of "run; quit;" did the trick. 

Thanks ballardw. 

David Cundiff

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1012 views
  • 2 likes
  • 3 in conversation