Hi:
I have a hard time understanding what you want. This program (stored process?) that you've attached looks like it will generate the report for ALL the regions. Do you mean that you ALSO want this stored process to "automatically" generate another set of reports -- one for each region AND you want the stored process to send the report AUTOMATICALLY to each region's printer?
To do that, you would need a second PROC REPORT step in this stored process or a separate stored process to generate a separate report for EACH region. There are several ways to do it. I would probably use a macro program to generate a report for each region. I don't think I would design one stored process to do the consolidated report and the report for every region. I'd keep them separate because then they'd be more re-usable that way -- you could get the consolidated report without getting the reports for every region or vice versa. Again, macro programs would help you out a lot here, because you could use a macro %do loop to cycle through all the regions or you could use macro logic to bypass the %do loop and generate a report for only 1 region. Tech Support can help you with the syntax to generate a report for each region -- either macro progam syntax or PROC REPORT syntax.
But, then, I would probably approach the problem in a different way:
1) make one stored process for the consolidated (All region) report
2) make a second stored process that would run for just 1 region
-- either invoke this second stored process using the Stored Process Web App -- so you could execute it from a script
-- or write a JSP or Java app to execute the stored process
-- or write a .NET app to execute the stored process
if you invoked the second stored process (assume it was called OneRegion) using the SPWA, you could do this:
<a href="http://www.wombat.com:9090/SASStoredProcess/do?_program=/SP_Folder/OneRegion®ion=Asia">
Run for Asia</a>
<a href="http://www.wombat.com:9090/SASStoredProcess/do?_program=/SP_Folder/OneRegion®ion=Canada">
Run for Canada</a>
I would NEVER try to send output directly to a printer unless I knew it was constantly monitored, always supplied with paper, somebody right there to troubleshoot problems, kind of printer. And even then, I probably wouldn't do it. Stuff happens to printers all the time...and if something happened, you'd have to rerun the SP to regenerate the output -- so you're back to needing a SP that you can invoke for just 1 region again. And, besides, I don't even think it's possible -- easily -- to send SP output directly to a printer. I could be wrong on this, but my idea of "easily" doesn't involve writing a custom front end or custom script -- which is what I think might be involved.
But, if you want to find out whether it's even possible to direct stored process output directly to a remote printer, you would have to contact Tech Support. This almost sounds like a job for a regular old batch job and not a stored process.
My approach would be a bit different. If I really needed to generate a report for EVERY region, I would have a folder or folders on a server and I'd generate my report for each region and stick the report in that folder. Then somebody in the region could come in every morning and print what was in the folder on the server. Every night or every xx number of days, I'd write my output to that folder -- either clearing out what was there or by putting out a report with a specific name that had the date embedded in it.
In any case, your best bet for help is to contact Tech Support.
cynthia