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;
@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?
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”:
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):
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 :
Let me know if this helps and if there is more information you need.
@Bari_sas Thanks. I had seen that page, but I am looking for actual documentation on this file download feature.
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
@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?
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.
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.
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.