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
Diamond | Level 26

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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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