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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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