@sasjs/core 4.16.1 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/mf_deletefile.sas +31 -0
- package/meta/mm_spkexport.sas +13 -5
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file
|
|
3
|
+
@brief Deletes a physical file, if it exists
|
|
4
|
+
@details Usage:
|
|
5
|
+
|
|
6
|
+
%mf_writefile(&sasjswork/myfile.txt,l1=some content)
|
|
7
|
+
|
|
8
|
+
%mf_deletefile(&sasjswork/myfile.txt)
|
|
9
|
+
|
|
10
|
+
%mf_deletefile(&sasjswork/myfile.txt)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@param filepath Full path to the target file
|
|
14
|
+
|
|
15
|
+
@returns The return code from the fdelete() invocation
|
|
16
|
+
|
|
17
|
+
<h4> Related Macros </h4>
|
|
18
|
+
@li mf_deletefile.test.sas
|
|
19
|
+
@li mf_writefile.sas
|
|
20
|
+
|
|
21
|
+
@version 9.2
|
|
22
|
+
@author Allan Bowe
|
|
23
|
+
**/
|
|
24
|
+
|
|
25
|
+
%macro mf_deletefile(file
|
|
26
|
+
)/*/STORE SOURCE*/;
|
|
27
|
+
%local rc fref;
|
|
28
|
+
%let rc= %sysfunc(filename(fref,&file));
|
|
29
|
+
%if %sysfunc(fdelete(&fref)) ne 0 %then %put %sysfunc(sysmsg());
|
|
30
|
+
%let rc= %sysfunc(filename(fref));
|
|
31
|
+
%mend mf_deletefile;
|
package/meta/mm_spkexport.sas
CHANGED
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
%let platform_object_path=%mf_loc(POF);
|
|
103
103
|
%let ds=%mf_getuniquename(prefix=spkexportable);
|
|
104
104
|
|
|
105
|
-
%mm_tree(root=%str(&metaloc)
|
|
105
|
+
%mm_tree(root=%str(&metaloc),types=EXPORTABLE ,outds=&ds)
|
|
106
106
|
|
|
107
107
|
%if %mf_isblank(&outref)=1 %then %let outref=%mf_getuniquefileref();
|
|
108
108
|
|
|
@@ -111,19 +111,27 @@ data _null_;
|
|
|
111
111
|
file &outref lrecl=32767;
|
|
112
112
|
length str $32767;
|
|
113
113
|
if _n_=1 then do;
|
|
114
|
+
put "# Script generated by &sysuserid on %sysfunc(datetime(),datetime19.)";
|
|
114
115
|
put "cd ""&platform_object_path"" \";
|
|
115
116
|
put "; ./ExportPackage -host &host -port &port -user &mmxuser \";
|
|
116
|
-
put " -disableX11 -password &mmxpass \"
|
|
117
|
+
put " -disableX11 -password &mmxpass \";
|
|
117
118
|
put " -package ""&cmdoutloc/&cmdoutname..spk"" \";
|
|
118
119
|
end;
|
|
119
120
|
/* exclude particular patterns from the exported SPK */
|
|
120
121
|
%if "&excludevars" ne "0" %then %do;
|
|
121
|
-
/* ignore top level folder else all subcontent will be exported regardless */
|
|
122
|
-
if _n_>1;
|
|
123
122
|
%do i=1 %to %sysfunc(countw(&excludevars));
|
|
124
123
|
%let var=%scan(&excludevars,&i);
|
|
125
|
-
if
|
|
124
|
+
if _n_=1 then do;
|
|
125
|
+
length excludestr&i $1000;
|
|
126
|
+
retain excludestr&i;
|
|
127
|
+
excludestr&i=symget("&var");
|
|
128
|
+
putlog excludestr&i=;
|
|
129
|
+
putlog path=;
|
|
130
|
+
end;
|
|
131
|
+
if index(path,cats(excludestr&i))=0 and index(name,cats(excludestr&i))=0;
|
|
126
132
|
%end;
|
|
133
|
+
/* ignore top level folder else all subcontent will be exported regardless */
|
|
134
|
+
if _n_>1;
|
|
127
135
|
%end;
|
|
128
136
|
str=' -objects '!!cats('"',path,'/',name,"(",publictype,')" \');
|
|
129
137
|
put str;
|
package/package.json
CHANGED