BookmarkSubscribeRSS Feed
ScottBass
Rhodochrosite | Level 12

OK, this request may be far fetched, but...

We have to write a macro that is a "wrapper" macro for another macro (provided by Futrix).  This wrapper macro will provide additional error checking and, in summary, provide an easier user interface to the Futrix provided macro.

We also want to create a stored process to provide a GUI to set the macro parameters.  So, a "programmer" will just call the macro in his/her code.  A "business user" will call the SP to display the prompts and set the parameters, and the SP will be a "one line" call to the macro.  The result is an output dataset.

The parameters go like:  select a source table, select columns from that table, create a where clause.  For the where clause, it would be cool if I could somehow call the EG where clause window, build a where clause, and have that where clause passed into a macro variable.  Or, has anyone ever written a where clause generator using the prompting capability of SAS stored processes?

Alternatively, has anyone created an EG custom task similar to the above?  It would be very much like the EG query builder, but instead of submitting code to SAS, it would set macro variables that I could pass to the macro.

Thanks,

Scott


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
1 REPLY 1
TriciaA
Calcite | Level 5

Maybe I'm oversimplistic in my thinking  - but it seems like you could collect the prompt value and then just use a something like a CAT function to build the Where statement.  How you build the code to support the prompt may require some fancy footwork if it has a lot of options.

*Note this coding is not exact - just communicating the idea.

data _null_;

TEMP_STMT=cats("Where ", " product=","&ProdPromptValue", " and ", "count >", "&CountPromptValue");

call symput ("where_stmt", temp_stmt);

run;

%your_macro(&where_stmt.)

         

    

Curious to know if this will work and if not what you did figure out.

Tricia

Blog: Notes for SAS BI Users

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1002 views
  • 0 likes
  • 2 in conversation