Desktop productivity for business analysts and programmers

Smart way to make repeated queries

New Contributor
Posts: 2

Smart way to make repeated queries


As a keen SAS EG user, there is one subject that i know have the potential to greatly simplyfy my work.

I often have one big dataset with data per month. Generally I need to join data from two months, e.g to look at changes over a 12 month-periods. I also have to repeat this query for several periods to have complete statistics.

Now i do this by making two separete queries from the dataset, with filter on each of the months i need to join. Then i join them back and look at differences etc between the two.

When i need to do this for say, 24 running 12 month-periods, it is a lot of entering queries and changing filters. Add a big dataset and this takes some time. Is there e.g. a little code that i can run, so i can enter "month 1" and "month 2" in a "pop up window" and then set up my logic from there? Or maybe even simpler ways to do this.

As you probably understand, i am not much into SAS coding myself.

An additional question: When i export dates from SAS EG to excel they are not recogniced by excel as dates (Norwegian version), and they end up like this 9/11/2006 12:00:00 AM, with a time stamp that i do not want or need, and it confuses excel thoroughly.

Any good ideas will be mostly appreciated!

Regards Fred Arve
Contributor Jay
Posts: 24

Re: Smart way to make repeated queries

If you are using EG 4.2, with in the query builder there is an icon labeled "prompt manager". This will build your prompt window. How to use it is straight forward and the help documentation is pretty good.

The date/time problem, every time I have encountered similar problems I had to fix it from the XL side i.e. it really isn't a SAS problem it's an XL problem.
New Contributor
Posts: 2

Re: Smart way to make repeated queries

Thanks Jay, we are still on 4.1 here, but i hope 4.2 will show up soon. Seems it has exactly what i was looking for.
Community Manager
Posts: 3,449

Re: Smart way to make repeated queries

Prompts are in 4.1, as "parameters". See the Tools->Macro (Parameters) Manager item.

You can then use these parameters in the query definition as part of your filter.

Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation