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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 615 views
  • 0 likes
  • 2 in conversation