BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
POOJA_J
Obsidian | Level 7

POOJA_J_0-1697027189697.png

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.

1 ACCEPTED SOLUTION

Accepted Solutions
4 REPLIES 4
Tom
Super User Tom
Super User

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?

POOJA_J
Obsidian | Level 7

Studying videos from the SAS, below is how they applied. So I came up with question of applying WHERE as a statement. 

POOJA_J_2-1697029245586.png

POOJA_J_3-1697029265302.png

 

 

 

 

PaigeMiller
Diamond | Level 26

@POOJA_J wrote:

POOJA_J_0-1697027189697.png

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
Kurt_Bremser
Super User

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.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 273 views
  • 1 like
  • 4 in conversation