sas >> WHERE clause operator requires compatible variables

by irinfigvam » Fri, 19 Sep 2008 08:26:20 GMT

I got the following error log:
=A0
489
490=A0 data contact;
491=A0 set contact;
492=A0 rename mbr_gender=3DGender;
493=A0 rename fname5=3Dfirst_name;
494=A0 keep policyno gender first_name;
495=A0 where policyno <> .;
NOTE: The "<>" operator is interpreted as "not equals".
ERROR: Where clause operator requires compatible variables.
496=A0 run;
=A0
What I am doing wrong?
=A0
Thank you in advance,
=A0
Irin
=A0=0A=0A=0A

sas >> WHERE clause operator requires compatible variables

by iebupdte » Fri, 19 Sep 2008 08:38:08 GMT


Policyno is character, missing dot(.) is numeric incompatable. For
more general solution use

where not missing(policyno);

then you don't need to know the type.

Similar Threads

1. Where clause operator requires compatible variables error

2. WHERE clause w/ IN or = operator in PROC SORT

Hi All,
Few days back i was coding a sas code. There was a part of code that i
wrote differently, the CPU time the different coding confused me. Here is
the code.
/* im taking out dates from a 4 datasets and would be using to extract some
rows from a table from DB2 */
Proc sql noprint;
select dates into : vlddates
from ( select input_date1
        from work.sample1
       union all
 select input_date2
        from work.sample1
       union all
 select input_date3
        from work.sample1
       union all
 select input_date4
        from work.sample1
);
quit;

proc sort data = db2lib.market_survey out=sushil(keep=cases takem_date);
by cases;
where taken_date in (&vlddates);
run;

Due to the IN operater the CPU time got increased substantially. But when I
write the same proc sort step number of unique dates that i get in VLDDATES
macro and concatanate the datasets. The time is considerably decreased. Can
anyone pls let me know what could be the reason.

proc sort data = db2lib.market_survey out=sushil(keep=cases takem_date);
by cases;
where taken_date in '20JAN2009'D; /* one of hte dates in VLDDATES macro*/
run;
.....
.repeating the proc sort the same way but for all the rest of the rows
present in the VLDDATES
..

Note :: taken_date is not indexed and the market_survey table is very huge
dataset.

Please help me understand why the increase in CPU time when IN operater is
used and why = operator decrease it. During my Test run, i realized that
when i used  = operator and combined the datasets, the whole operation took
13.53 CPU min, while when i used the IN oprator, the whole operation took
752.23 CPU min..

Thanks!

3. Macro vars: 'required operator not found' error in %if &var

4. Macro vars: 'required operator not found' error in %if &var ne

Hi all -

Yet another macro resolution issue that I'm stuck on.
I've tried quotes around the "ALL", etc.
I've tried putting resolve around each  (upcase(VAR) ne ALL*) bit, I've
tried removing the resolve bits.
I've tried saying %if &hetvarmeth not in ("ALL", . . .)
I know it's saying lack of required operator (and continued to with those
variations); I just don't know what I need to do to have a valid operator.
Thoughts?
Venita


%if resolve(upcase("&hetvarmeth") ne ALL and upcase("&hetvarmeth") ne
ALLBIVAR and
                        upcase("&hetvarmeth") ne ALLMULTIVAR) %then %do; .
. . . . %end;

The log:
SYMBOLGEN:  Macro variable HETVARMETH resolves to ALLMULTIVAR
ERROR: Required operator not found in expression:
resolve(upcase("&hetvarmeth")
       ne ALL and upcase("&hetvarmeth") ne ALLBIVAR and
       upcase("&hetvarmeth") ne ALLMULTIVAR)

5. Macro vars: 'required operator not found' error - was due to

6. Macrotrouble - ERROR: Required operator not found in

7. Macrotrouble - ERROR: Required operator not found in expression

8. How to create required format variable based on the variable name and variable birthday

For example:

value of name: John
value of Birthday: 090225 (format as yymmdd6.)

New value for the new variable: John090225; for the new variable, the
birthday keeps yymmdd format(two digits year, two digits month, two
digits day).

Thank you!