From 4d6edf5566deafd4d01722882cf6e342ddd49b4c Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 30 May 2021 13:22:50 +0300 Subject: [PATCH] feat: additional options for mv_createfile.sas, also a log message to enable file to be easily opened --- viya/mv_createfile.sas | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/viya/mv_createfile.sas b/viya/mv_createfile.sas index 7382baf..c90e95c 100644 --- a/viya/mv_createfile.sas +++ b/viya/mv_createfile.sas @@ -17,6 +17,10 @@ @param [in] path= The parent folder in which to create the file @param [in] name= The name of the file to be created @param [in] inref= The fileref pointing to the file to be uploaded + @param [in] contentdisp= (inline) Content Disposition. Example values: + @li inline + @li attachment + @param [in] access_token_var= The global macro variable to contain the access token, if using authorization_code grant type. @param [in] grant_type= (sas_services) Valid values are: @@ -41,6 +45,7 @@ %macro mv_createfile(path= ,name= ,inref= + ,contentdisp=inline ,access_token_var=ACCESS_TOKEN ,grant_type=sas_services ,mdebug=0 @@ -88,10 +93,21 @@ /* create file with relevant options */ %local fref; %let fref=%mf_getuniquefileref(); -filename &fref filesrvc folderPath="&path" filename="&name"; +filename &fref filesrvc + folderPath="&path" + filename="&name" + cdisp="&contentdisp"; %mp_binarycopy(inref=&inref, outref=&fref) filename &fref clear; +%local base_uri; /* location of rest apis */ +%let base_uri=%mf_getplatform(VIYARESTAPI); + +%put &sysmacroname: File &name successfully created in &path; +%put &sysmacroname:;%put; +%put &base_uri/SASJobExecution?_file=&path/&name;%put; +%put &sysmacroname:; + %mend mv_createfile; \ No newline at end of file