BookmarkSubscribeRSS Feed
chris_lampron
Fluorite | Level 6

I am currently using SAS Enterprise Guide 5.1 where I have a stored process that is being executed through Internet Explorer 10.  I have multiple datasets being created and I was wondering if it is possible to have the user choose where to download two datasets.

The code below is what I am using to have the user select a directory and save an .xls copy of the dataset.  This code works fine for selecting one dataset and saving it on the users local machine.

     %global _ODSDEST _ODSSTYLE _ODSOPTIONS;

     *ProcessBody;

     %macro print;

          %local OLD_HEADER OUTPUT_FORMAT;

          %let OUTPUT_FORMAT = &_ODSDEST;

          %let _ODSDEST = tagsets.ExcelXP;

          %let OUTPUT_FORMAT = HTML;

          %let OLD_HEADER =

          %sysfunc(stpsrv_header(Content-type,application/vnd.ms-excel));  

            %STPBEGIN;

                 proc print data=wr_stat;run;

            %STPEND;

     %mend print;

     %print;

I tried using a sleep function and then printing another dataset within the %STPBEGIN/END, but I'm not sure if what I'm doing is incorrect or if it is even possible to do.  The program runs and allows the user to select where to save the file, but it will only do it for the second dataset in the second proc print.

     %global _ODSDEST _ODSSTYLE _ODSOPTIONS;

     *ProcessBody;

     %macro print;

          %local OLD_HEADER OUTPUT_FORMAT;

          %let OUTPUT_FORMAT = &_ODSDEST;

          %let _ODSDEST = tagsets.ExcelXP;

          %let OUTPUT_FORMAT = HTML;

          %let OLD_HEADER =

          %sysfunc(stpsrv_header(Content-type,application/vnd.ms-excel));  

       %STPBEGIN;

            proc print data=wr_stat;run;

            data _null_;

                 slept =sleep(20);

            run;

           proc print wr_stat2;run;

       %STPEND;

     %mend print;

     %print;

Do I need to edit my syntax or is there a completely different method to doing this?

1 REPLY 1
Cynthia_sas
SAS Super FREQ

HI:

  I believe you will need a second stored process for the second file. But this really is more of a question for Tech Support.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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