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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 863 views
  • 0 likes
  • 2 in conversation