BookmarkSubscribeRSS Feed
Phoebelee
Fluorite | Level 6

I keep getting error warning like this:

1729 DATA PROJECT.MERGE_ALL;
1730 merge REHABILITATION4(in=Phoebe) DISCHARGE5(in=Fredo) EMERGENCY5(in=lego) ;
1731 by COUNTY_Name;
1732 drop county;
1733 if Phoebe Fredo lego;
                          -----
                          388
                           76
ERROR 388-185: Expecting an arithmetic operator.

ERROR 76-322: Syntax error, statement will be ignored.

 

 

Can someone help to look what wrong with the code?

Thanks a lot !!!

 

 

 

here is my code:

 

 

DATA PROJECT.MERGE_ALL;
merge REHABILITATION4(in=Phoebe) DISCHARGE5(in=Fredo) EMERGENCY5(in=lego) ;
by COUNTY_Name;
drop county;
if Phoebe Fredo lego;
Format COUNTY_Name $24.;
run;
proc print data=merge_all;
run;
proc contents data= MERGE_ALL;
run;

2 REPLIES 2
Tom
Super User Tom
Super User

What did you intend by this statement?

if Phoebe Fredo lego;
ballardw
Super User

When a variable is used in an IF SAS either expects a comparison such as =, <, >, ge or similar if there is a second variable mentioned.

 

Phoebe, Fredo and Lego are currently numeric variables with values of 0 or 1. Depending on what you are attempting then the statement should be

 

If Phoebe =1 AND Fredo=1 and Lego=1; if you want records with all three sets contributing.

This can be shortened to :

If Phoebe And Fredo And Lego; because SAS will treat non-0 and non-missing values as "True" in a comparison.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1596 views
  • 1 like
  • 3 in conversation