BookmarkSubscribeRSS Feed
SASDump
Calcite | Level 5
I am using the EG 4.3 query builder to select and filter data from dataset for generating report with parameter prompt.

The parameter required will be ad-hoc SQL command e.g. year = 2009 and month = 1

i able to perform such ad-hoc SQL when the parameter is entered, but get error when the parameter is left empty. I know there is an option for "Required non-blank variable" in the parameter prompt, by checking this the parameter cannot be left blank before submitting. But if i want to allow it to be blank, is there any workaround or trick for doing such magical query?

I now assigned a "cond" variable for the ad-hoc condition and setting the filter = &cond for performing such ad-hoc query. i have tried using case when &cond ='' then 1=1 else &cond end but fail with error.

Any one has idea to this problem? Thanks in advance!
1 REPLY 1
jklaverstijn
Rhodochrosite | Level 12
Maybe your case construct will work with a small adaptation. Use quotes like:

case when "&cond" ='' then 1=1 else &cond

Good luck.
- Jan.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 652 views
  • 0 likes
  • 2 in conversation