Desktop productivity for business analysts and programmers

Looping a Process With Different Prompts

Posts: 58

Looping a Process With Different Prompts

I have a process that produces a large dataset.  I have to deliver the data to Excel, but cut down into different subsets.  I can do this easily enough fully automatically, however I have some statistics that I'm adding in that create rankings within each subset.  I can do this as well, but the result is I end up with around 20 different columns for each statistic that I'm asked to produce. 


I'm basically being asked to identify whether an entity sits in the top 10 by whatever measure nationally, within it's sector, within it's region and a few other things.


It's all very messy.


What I would like to do is build the dataset for the whole population, with just one ranking column per statistic and then use prompts to control the population, so the data is filtered at the start and the rankings relate to just that population.  But I don't want to lose the automatic running that I have wit the first method.


Is there a way to setup a table with columns for each prompt variable and the variables for each subset of data I want to produce and then loop through the process flow so that it runs once for each subset I require using the correct prompt values?


Ideally I'd like to use Export as Step in Process to drop the results out as .csv files, but I'd like to modify the file name to reflect the prompts being applied, so I end up with 20 .csv files correctly named automatically.  I can't use any other method of outputting data as I have no write access to the SAS server, so I'm not sure this is possible.  I know if I don't tick the over-write option I'll end up with the files, just with annoying names.




PS - SAS 5.1.

Valued Guide
Posts: 560

Re: Looping a Process With Different Prompts

Posted in reply to paulrockliffe

Check this my yesterdays post on how to create a prompt.


You can add macro variables in your existing code and then prompt them. 

Posts: 58

Re: Looping a Process With Different Prompts

Posted in reply to SuryaKiran

Thanks, I know how to create the Prompts, it's the rest of it that is new to me.


If I'm in a Program within Enterprise Guide, is there a command that will cause Enterprise Guide to run a Process Flow or a Particular Query Builder node that exists in the Project?


I think I can build the conditional loops I need, but I'm stuck on the above and Google isn't throwing much up!


Thanks again.

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