05-01-2017 07:14 PM - edited 05-01-2017 07:17 PM
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;
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:
merge REHABILITATION4(in=Phoebe) DISCHARGE5(in=Fredo) EMERGENCY5(in=lego) ;
if Phoebe Fredo lego;
Format COUNTY_Name $24.;
proc print data=merge_all;
proc contents data= MERGE_ALL;
05-01-2017 07:24 PM
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.