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

I can't get these proc export queries to run on these variables.  Is there something wrong with the formatting, or with my query, or both?


Proc export data=MAUDE.Total1999thru2013 (where=(MDR_REPORT_KEY<'50'))

dbms=excel file="...\Output\test11.xls";

run;

ERROR: WHERE clause operator requires compatible variables.

ERROR: Export unsuccessful.  See SAS Log for details.

Proc export data=MAUDE.Total1999thru2013 (where=(MDR_REPORT_KEY ='100'))

dbms=excel file="...\Output\test13.xls";

run;

ERROR: WHERE clause operator requires compatible variables.

ERROR: Export unsuccessful.  See SAS Log for details.

mdr and event.JPGmdr.JPG

Proc export data=MAUDE.Total1999thru2013 (where=(EVENT_KEY ='100'))

dbms=excel file="...\Output\test14.xls";

run;


141! Destination\Output\test14.xls";

ERROR 22-322: Syntax error, expecting one of the following: ;, DATA, DBLABEL, DBMS, DEBUG, FILE,

              LABEL, OUTFILE, OUTTABLE, REPLACE, TABLE, _DEBUG_.

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

142  run;

mdr and event.JPGevent.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Remove the quotes from your value in the where option.  The field is numeric e.g. 50, but you are trying to compare it to '50' i.e., character

View solution in original post

2 REPLIES 2
art297
Opal | Level 21

Remove the quotes from your value in the where option.  The field is numeric e.g. 50, but you are trying to compare it to '50' i.e., character

Tegan
Calcite | Level 5

Thank you, Arthur!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 4045 views
  • 0 likes
  • 2 in conversation