Desktop productivity for business analysts and programmers

Can I call the EG where clause generator from a stored process?

Super Contributor
Posts: 398

Can I call the EG where clause generator from a stored process?

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.



Posts: 40

Can I call the EG where clause generator from a stored process?

Posted in reply to ScottBass

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);





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


Blog: Notes for SAS BI Users

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation