Hello , good morning,
I want place a condition "where " in a proc export like this :
proc export data=work.refec9 (where=(acteur="toto") (statut<>"tata")) outfile="\\serveur\\dossier\sousdossier\truc.xlsx" dbms=XLSX replace ;
sheet="a_traiter";
run;
I have tried to follow the law which are here with unsuccess : http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001000998.htm
Can you give me your opinion
Thanks for the help
[KB] fixed the link
A where condition needs to be a syntactically valid boolean expression.
(acteur="toto") (statut<>"tata")
clearly is not.
(acteur="toto" and statut<>"tata")
or
(acteur="toto" or statut<>"tata")
are.
You just have to keep reading on in the documentation:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000131192.htm
A where condition needs to be a syntactically valid boolean expression.
(acteur="toto") (statut<>"tata")
clearly is not.
(acteur="toto" and statut<>"tata")
or
(acteur="toto" or statut<>"tata")
are.
You just have to keep reading on in the documentation:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000131192.htm
Excellent for your link , I keep this in my paper note .
This:
(where=(acteur="toto") (statut<>"tata"))
Is not a valid where clause. Where clause take the form:
where <condition> [logical operator <condition>];
So:
(where=(acteur="toto" and statut<>"tata"))
Would work.
You are trying to do a where clause like its options - e.g. keep or drop or where.
I have tried this code :
proc export data=work.ma_table (where=(champ1<>"XXXX" and champ2="YYYY" )) outfile="\\serveur\\dossier\sous dossier\\fichier.xlsx" dbms=XLSX replace ; sheet="nomfeuille2"; run;
It's ok in my side , there is a result in out 😄
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.
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.
Ready to level-up your skills? Choose your own adventure.