- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm learning to code macros. Once macro is created I want to check that and so I used proc catalog. My question is why WHERE doesn't give required results as a Statement. But using it as an option gives results. I assumed WHERE should give results when used either as a Statement or Option. Plz explain the logic behind this.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
A WHERE statement in a procedure is applied to (a) dataset(s) being read by the procedure. Since you do not (and can not) read a dataset with PROC CATALOG, the statement cannot be supported.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Because PROC CATALOG does not support the WHERE statement.
What purpose would the WHERE statement even do for PROC CATALOG? It does not read in any datasets so what could the WHERE clause be applied to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Studying videos from the SAS, below is how they applied. So I came up with question of applying WHERE as a statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@POOJA_J wrote:
I'm learning to code macros. Once macro is created I want to check that and so I used proc catalog. My question is why WHERE doesn't give required results as a Statement. But using it as an option gives results. I assumed WHERE should give results when used either as a Statement or Option. Plz explain the logic behind this.
Your question really has nothing to do with the small macro you wrote. But ... since @Tom has already questioned your use of WHERE in PROC CATALOG, let me point out that in order to write macros that work, you need to first have SAS code without macros and without macro variables that works properly. If you can't write such code without macros and without macro variables, then you will never get macros to work.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
A WHERE statement in a procedure is applied to (a) dataset(s) being read by the procedure. Since you do not (and can not) read a dataset with PROC CATALOG, the statement cannot be supported.