- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Excellent for your link , I keep this in my paper note .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 😄