BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

I saw an interesting article on this site that seems to saying you can have SAS/Studio download a file that your SAS code generates.  

 

But I cannot find ANY documentation on this feature and how to use it.

 

Try this program in SAS/Studio

%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=class.csv;

data _null_;
  file _dataout dsd ;
  set sashelp.class ;
  if _n_=1 then put 'name,age,sex';
  put name age sex;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@M_Dexter wrote:

Hi Tom,

 

Thank you so much for your request.  We have added a new_DATAOUT topic to the SAS Studio documentation.

You can check it out at Exporting a File That Uses the _DATAOUT Macros.

 

Please let us know if you have additional feedback!

 

Marie

 


Thanks.  But I am confused by the language in the document.  It talks about _DATAOUT macros, but the code does not use any macros.  Just macro variables (also called SYMBOLS in the SAS documentation).

 

I am also confused by the location of this document.  It is placed in the section on how to modify a repository of code.  It does not appear to me that this functionality is related to the repository feature of SAS/Studio.

 

There are still a lot of unanswered questions.

 

What is it that triggers the interface to download the file?  It seems that the trigger is the use of the _DATAOUT fileref.

Can the user redirect the _DATAOUT fileref to some existing file and have the system download that file?

 

View solution in original post

7 REPLIES 7
Bari_sas
SAS Employee

Hi Tom!

 

I don’t see the fileref _dataout officially documented either. It’s part of the (voluminous) precode that is generated by default by SAS Studio.

 

From SAS Studio 5.2 Enterprise, if I choose options..preferences. Under “code and log” I see “Show generated SAS code in the SAS log”:

 

Bari_sas_0-1619799531141.png

 

 

With this preference enabled, when I submit any code from SAS Studio, I see the precode in the log (with filename _DATAOUT shown here at line 20):

 

Bari_sas_1-1619799531145.png

 

So the existence of that fileref helps the code that you are showing create a file that is downloaded. Here's a doc reference I am finding on the macro variables _DATAOUT_MIME_TYPE &  _DATAOUT_NAME :

 

https://go.documentation.sas.com/doc/en/webeditorcdc/3.6/webeditorrepodg/n0303y7wu1a1myn13kuatdwnfqd...

Let me know if this helps and if there is more information you need.

Tom
Super User Tom
Super User

@Bari_sas Thanks.  I had seen that page, but I am looking for actual documentation on this file download feature.

M_Dexter
SAS Employee

Hi Tom,

 

Thank you so much for your request.  We have added a new_DATAOUT topic to the SAS Studio documentation.

You can check it out at Exporting a File That Uses the _DATAOUT Macros.

 

Please let us know if you have additional feedback!

 

Marie

 

Tom
Super User Tom
Super User

@M_Dexter wrote:

Hi Tom,

 

Thank you so much for your request.  We have added a new_DATAOUT topic to the SAS Studio documentation.

You can check it out at Exporting a File That Uses the _DATAOUT Macros.

 

Please let us know if you have additional feedback!

 

Marie

 


Thanks.  But I am confused by the language in the document.  It talks about _DATAOUT macros, but the code does not use any macros.  Just macro variables (also called SYMBOLS in the SAS documentation).

 

I am also confused by the location of this document.  It is placed in the section on how to modify a repository of code.  It does not appear to me that this functionality is related to the repository feature of SAS/Studio.

 

There are still a lot of unanswered questions.

 

What is it that triggers the interface to download the file?  It seems that the trigger is the use of the _DATAOUT fileref.

Can the user redirect the _DATAOUT fileref to some existing file and have the system download that file?

 

david_hou
Calcite | Level 5

Is there a way of uploading local file into Viya server, similar to this _Dataout way? Otherwise we have to use FTP tools to save to the server first, then use the proc import. It would be very helpful and convenient if a similar approach is available to upload local file directly into Viya / Studio server.

david_hou
Calcite | Level 5

Is there a way of uploading local file into Viya server, similar to this _Dataout way? Otherwise we have to use FTP tools to save to the server first, then use the proc import. It would be very helpful and convenient if a similar approach is available to upload local file directly into Viya / Studio server.

Bari_sas
SAS Employee

To address the following question:

 

Is there a way of uploading local file into Viya server, similar to this _Dataout way? Otherwise we have to use FTP tools to save to the server first, then use the proc import. It would be very helpful and convenient if a similar approach is available to upload local file directly into Viya / Studio server.

 

There is not an automated process that makes local files from your client PC available to the SAS Viya server. I suggest the following blog as a resource:

https://blogs.sas.com/content/sgf/2022/02/14/where-are-the-files-that-you-have-access-to-through-sas...

..and if you have follow up questions I would be happy to address them via a tracking entry opened to Technical Support. This will help us have a direct dialog if I need more information about your Viya environment. 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 7 replies
  • 5940 views
  • 6 likes
  • 4 in conversation