1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-28 21:30:05 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Allan Bowe
4d6edf5566 feat: additional options for mv_createfile.sas, also a log message to enable file to be easily opened 2021-05-30 13:22:50 +03:00
Allan Bowe
41a24677f5 chore: automated commit 2021-05-27 09:42:15 +03:00
Allan Bowe
e7d8d8ffb3 chore: updating docs 2021-05-27 09:40:38 +03:00
7 changed files with 47 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
"hasMacroParentheses": true,
"noNestedMacros": false,
"noSpacesInFileNames": true,
"maxLineLength": 135,
"maxLineLength": 230,
"lowerCaseFileNames": true,
"noTabIndentation": true,
"indentationMultiple": 2

16
all.sas
View File

@@ -8810,7 +8810,7 @@ Usage:
@param code=(ft15f001) Space seperated fileref(s) of the actual code to be
added
@param server=(SASApp) The server which will run the STP. Server name or uri
is fine.
is fine.
@param mDebug=(0) set to 1 to show debug messages in the log
@param replace=(YES) select NO to avoid replacing an existing service in that
location
@@ -12791,8 +12791,8 @@ run;
Usage:
%put %mfv_existfile(/does/exist.txt);
%put %mfv_existfile(/does/not/exist.txt);
%put %mfv_existfile(/does/exist.txt);
%put %mfv_existfile(/does/not/exist.txt);
@param filepath The full path to the file on SAS drive (eg /Public/myfile.txt)
@@ -12800,6 +12800,9 @@ run;
@li mf_abort.sas
@li mf_getuniquefileref.sas
<h4> Related Macros </h4>
@li mfv_existfolder.sas
@version 3.5
@author [Allan Bowe](https://www.linkedin.com/in/allanbowe/)
**/
@@ -12838,8 +12841,8 @@ run;
Usage:
%put %mfv_existfolder(/does/exist);
%put %mfv_existfolder(/does/not/exist);
%put %mfv_existfolder(/does/exist);
%put %mfv_existfolder(/does/not/exist);
@param path The path to the folder on SAS drive
@@ -12847,6 +12850,9 @@ run;
@li mf_abort.sas
@li mf_getuniquefileref.sas
<h4> Related Macros </h4>
@li mfv_existfile.sas
@version 3.5
@author [Allan Bowe](https://www.linkedin.com/in/allanbowe/)
**/

View File

@@ -42,6 +42,13 @@
*/
/*! \dir Tests
* \brief SASjs Tests
* \details These folders contain the macro tests. They are first compiled
and deployed (sasjs cbd) then executed (sasjs test).
*/
/*! \dir viya
* \brief Viya macros
* \details These macros have the following attributes:

View File

@@ -40,7 +40,7 @@ Usage:
@param code=(ft15f001) Space seperated fileref(s) of the actual code to be
added
@param server=(SASApp) The server which will run the STP. Server name or uri
is fine.
is fine.
@param mDebug=(0) set to 1 to show debug messages in the log
@param replace=(YES) select NO to avoid replacing an existing service in that
location

View File

@@ -9,8 +9,8 @@
Usage:
%put %mfv_existfile(/does/exist.txt);
%put %mfv_existfile(/does/not/exist.txt);
%put %mfv_existfile(/does/exist.txt);
%put %mfv_existfile(/does/not/exist.txt);
@param filepath The full path to the file on SAS drive (eg /Public/myfile.txt)
@@ -18,6 +18,9 @@
@li mf_abort.sas
@li mf_getuniquefileref.sas
<h4> Related Macros </h4>
@li mfv_existfolder.sas
@version 3.5
@author [Allan Bowe](https://www.linkedin.com/in/allanbowe/)
**/

View File

@@ -9,8 +9,8 @@
Usage:
%put %mfv_existfolder(/does/exist);
%put %mfv_existfolder(/does/not/exist);
%put %mfv_existfolder(/does/exist);
%put %mfv_existfolder(/does/not/exist);
@param path The path to the folder on SAS drive
@@ -18,6 +18,9 @@
@li mf_abort.sas
@li mf_getuniquefileref.sas
<h4> Related Macros </h4>
@li mfv_existfile.sas
@version 3.5
@author [Allan Bowe](https://www.linkedin.com/in/allanbowe/)
**/

View File

@@ -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;