Desktop productivity for business analysts and programmers

Is It Possible To Export 2 Datasets Using Tagsets.ExcelXP?

Reply
Occasional Contributor
Posts: 17

Is It Possible To Export 2 Datasets Using Tagsets.ExcelXP?

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?

SAS Super FREQ
Posts: 8,820

Re: Is It Possible To Export 2 Datasets Using Tagsets.ExcelXP?

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

Ask a Question
Discussion stats
  • 1 reply
  • 266 views
  • 0 likes
  • 2 in conversation