@sasjs/utils 3.5.0 → 3.5.2
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/.all-contributorsrc +12 -1
- package/.github/workflows/run-tests-windows.yml +1 -1
- package/.github/workflows/run-tests.yml +1 -1
- package/README.md +15 -12
- package/file/file.d.ts +1 -1
- package/file/file.js +4 -2
- package/file/file.js.map +1 -1
- package/macros/mf_abort.sas +7 -2
- package/macros/mf_deletefile.sas +1 -1
- package/macros/mf_existds.sas +1 -1
- package/macros/mf_existfileref.sas +2 -2
- package/macros/mf_existfunction.sas +1 -1
- package/macros/mf_existvar.sas +8 -4
- package/macros/mf_existvarlist.sas +2 -2
- package/macros/mf_getapploc.sas +1 -0
- package/macros/mf_getattrc.sas +2 -2
- package/macros/mf_getattrn.sas +2 -2
- package/macros/mf_getfmtlist.sas +3 -4
- package/macros/mf_getgitbranch.sas +37 -0
- package/macros/mf_getkeyvalue.sas +3 -2
- package/macros/mf_getplatform.sas +1 -1
- package/macros/mf_getschema.sas +1 -1
- package/macros/mf_getuniquelibref.sas +1 -1
- package/macros/mf_getuniquename.sas +1 -1
- package/macros/mf_getuser.sas +0 -2
- package/macros/mf_getvalue.sas +3 -3
- package/macros/mf_getvarformat.sas +2 -1
- package/macros/mf_getvarlen.sas +2 -2
- package/macros/mf_getvarnum.sas +2 -2
- package/macros/mf_getvartype.sas +2 -2
- package/macros/mf_getxengine.sas +1 -1
- package/macros/mf_increment.sas +2 -2
- package/macros/mf_isblank.sas +2 -2
- package/macros/mf_isdir.sas +1 -1
- package/macros/mf_loc.sas +6 -1
- package/macros/mf_mkdir.sas +1 -1
- package/macros/mf_mval.sas +2 -0
- package/macros/mf_nobs.sas +1 -1
- package/macros/mf_readfile.sas +63 -0
- package/macros/mf_trimstr.sas +2 -2
- package/macros/mf_wordsinstr1andstr2.sas +2 -2
- package/macros/mf_wordsinstr1butnotstr2.sas +2 -2
- package/macros/mf_writefile.sas +2 -2
- package/macros/mp_abort.sas +50 -13
- package/macros/mp_aligndecimal.sas +95 -0
- package/macros/mp_appendfile.sas +2 -2
- package/macros/mp_applyformats.sas +5 -5
- package/macros/mp_assert.sas +1 -1
- package/macros/mp_assertcols.sas +3 -3
- package/macros/mp_assertcolvals.sas +9 -5
- package/macros/mp_base64copy.sas +2 -2
- package/macros/mp_binarycopy.sas +7 -6
- package/macros/mp_chop.sas +4 -3
- package/macros/mp_cleancsv.sas +5 -4
- package/macros/mp_cntlout.sas +16 -7
- package/macros/mp_copyfolder.sas +2 -2
- package/macros/mp_createconstraints.sas +3 -3
- package/macros/mp_createwebservice.sas +1 -1
- package/macros/mp_csv2ds.sas +6 -5
- package/macros/mp_deleteconstraints.sas +5 -3
- package/macros/mp_deletefolder.sas +1 -1
- package/macros/mp_dictionary.sas +1 -1
- package/macros/mp_dirlist.sas +1 -1
- package/macros/mp_distinctfmtvalues.sas +5 -5
- package/macros/mp_ds2csv.sas +10 -1
- package/macros/mp_ds2ddl.sas +14 -2
- package/macros/mp_ds2md.sas +1 -0
- package/macros/mp_dsmeta.sas +2 -2
- package/macros/mp_filtercheck.sas +105 -16
- package/macros/mp_filtergenerate.sas +2 -2
- package/macros/mp_filterstore.sas +4 -3
- package/macros/mp_getcols.sas +3 -2
- package/macros/mp_getdbml.sas +4 -4
- package/macros/mp_getddl.sas +15 -10
- package/macros/mp_getformats.sas +13 -3
- package/macros/mp_gitlog.sas +104 -0
- package/macros/mp_gitstatus.sas +1 -1
- package/macros/mp_gsubfile.sas +6 -6
- package/macros/mp_guesspk.sas +1 -1
- package/macros/mp_hashdataset.sas +1 -1
- package/macros/mp_init.sas +1 -0
- package/macros/mp_lib2cards.sas +7 -7
- package/macros/mp_loadformat.sas +127 -47
- package/macros/mp_lockanytable.sas +31 -24
- package/macros/mp_md5.sas +3 -4
- package/macros/mp_perflog.sas +3 -3
- package/macros/mp_prevobs.sas +5 -5
- package/macros/mp_recursivejoin.sas +7 -6
- package/macros/mp_replace.sas +5 -4
- package/macros/mp_runddl.sas +3 -3
- package/macros/mp_searchcols.sas +7 -6
- package/macros/mp_stackdiffs.sas +1 -0
- package/macros/mp_storediffs.sas +8 -8
- package/macros/mp_stprequests.sas +4 -3
- package/macros/mp_stripdiffs.sas +255 -0
- package/macros/mp_testjob.sas +2 -2
- package/macros/mp_testwritespeedlibrary.sas +3 -3
- package/macros/mp_tree.sas +2 -2
- package/macros/mp_unzip.sas +5 -4
- package/macros/mp_updatevarlength.sas +3 -3
- package/macros/mp_validatecol.sas +3 -3
- package/macros/mp_wait4file.sas +1 -1
- package/macros/mp_webin.sas +1 -1
- package/macros/mp_zip.sas +5 -5
- package/package.json +5 -6
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file
|
|
3
|
+
@brief Generates a stage dataset to revert diffs tracked in an audit table
|
|
4
|
+
@details A big benefit of tracking data changes in an audit table is that
|
|
5
|
+
those changes can be subsequently reverted if necessary!
|
|
6
|
+
|
|
7
|
+
This macro prepares a staging dataset containing those differences - eg for:
|
|
8
|
+
|
|
9
|
+
@li deleted rows - these are re-inserted
|
|
10
|
+
@li changed rows - differences are reverted
|
|
11
|
+
@li added rows - marked with `_____DELETE__THIS__RECORD_____="YES"`
|
|
12
|
+
|
|
13
|
+
These changes are NOT applied to the base table - a staging dataset is
|
|
14
|
+
simply prepared for an ETL process to action. In Data Controller, this
|
|
15
|
+
dataset is used directly as an input to the APPROVE process (so that the
|
|
16
|
+
reversion diffs can be reviewed prior to being applied).
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@param [in] libds Base library.dataset (will not be modified). The library
|
|
20
|
+
must be assigned.
|
|
21
|
+
@param [in] loadref Unique identifier for the version to be reverted. This
|
|
22
|
+
change, plus ALL SUBSEQUENT CHANGES, will be reverted in the output table.
|
|
23
|
+
@param [in] difftable The dataset containing the diffs. Definition available
|
|
24
|
+
in mddl_dc_difftable.sas
|
|
25
|
+
@param [in] filtervar= (0) If provided, the contents of this macro variable
|
|
26
|
+
will be applied as an additional filter against &libds
|
|
27
|
+
@param [out] outds= (work.mp_stripdiffs) Output table containing the diffs.
|
|
28
|
+
Has the same format as the base datset, plus a
|
|
29
|
+
`_____DELETE__THIS__RECORD_____` variable.
|
|
30
|
+
@param [in] mdebug= set to 1 to enable DEBUG messages and preserve outputs
|
|
31
|
+
|
|
32
|
+
<h4> SAS Macros </h4>
|
|
33
|
+
@li mf_getuniquefileref.sas
|
|
34
|
+
@li mf_getuniquename.sas
|
|
35
|
+
@li mf_getvarlist.sas
|
|
36
|
+
@li mf_islibds.sas
|
|
37
|
+
@li mf_wordsinstr1butnotstr2.sas
|
|
38
|
+
@li mp_abort.sas
|
|
39
|
+
|
|
40
|
+
<h4> Related Macros </h4>
|
|
41
|
+
@li mddl_dc_difftable.sas
|
|
42
|
+
@li mp_stackdiffs.sas
|
|
43
|
+
@li mp_storediffs.sas
|
|
44
|
+
@li mp_stripdiffs.test.sas
|
|
45
|
+
|
|
46
|
+
@version 9.2
|
|
47
|
+
@author Allan Bowe
|
|
48
|
+
**/
|
|
49
|
+
/** @cond */
|
|
50
|
+
|
|
51
|
+
%macro mp_stripdiffs(libds
|
|
52
|
+
,loadref
|
|
53
|
+
,difftable
|
|
54
|
+
,filtervar=0
|
|
55
|
+
,outds=work.mp_stripdiffs
|
|
56
|
+
,mdebug=0
|
|
57
|
+
)/*/STORE SOURCE*/;
|
|
58
|
+
%local dbg;
|
|
59
|
+
%if &mdebug=1 %then %do;
|
|
60
|
+
%put &sysmacroname entry vars:;
|
|
61
|
+
%put _local_;
|
|
62
|
+
%end;
|
|
63
|
+
%else %let dbg=*;
|
|
64
|
+
|
|
65
|
+
%let libds=%upcase(&libds);
|
|
66
|
+
|
|
67
|
+
/* safety checks */
|
|
68
|
+
%mp_abort(iftrue= (&syscc ne 0)
|
|
69
|
+
,mac=&sysmacroname
|
|
70
|
+
,msg=%str(SYSCC=&syscc on entry. Clean session required!)
|
|
71
|
+
)
|
|
72
|
+
%let libds=%upcase(&libds);
|
|
73
|
+
%mp_abort(iftrue= (%mf_islibds(&libds)=0)
|
|
74
|
+
,mac=&sysmacroname
|
|
75
|
+
,msg=%str(Invalid library.dataset reference - %superq(libds))
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
/* set up unique and temporary vars */
|
|
79
|
+
%local ds1 ds2 ds3 ds4 ds5 fref1 filterstr;
|
|
80
|
+
%let fref1=%mf_getuniquefileref();
|
|
81
|
+
%if &filtervar ne 0 %then %let filterstr=%superq(&filtervar);
|
|
82
|
+
%else %let filterstr=%str(1=1);
|
|
83
|
+
|
|
84
|
+
/* get timestamp of the diff to be reverted */
|
|
85
|
+
%local ts;
|
|
86
|
+
proc sql noprint;
|
|
87
|
+
select put(processed_dttm,datetime19.6) into: ts
|
|
88
|
+
from &difftable where load_ref="&loadref";
|
|
89
|
+
%mp_abort(iftrue= (&sqlobs=0)
|
|
90
|
+
,mac=&sysmacroname
|
|
91
|
+
,msg=%str(Load ref %superq(loadref) not found!)
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
/* extract diffs for this base table from this timestamp onwards */
|
|
95
|
+
%let ds1=%upcase(work.%mf_getuniquename(prefix=mpsd_diffs));
|
|
96
|
+
create table &ds1 (drop=libref dsn) as
|
|
97
|
+
select * from &difftable
|
|
98
|
+
where upcase(cats(libref))="%scan(&libds,1,.)"
|
|
99
|
+
and upcase(cats(dsn))="%scan(&libds,2,.)"
|
|
100
|
+
and processed_dttm ge "&ts"dt
|
|
101
|
+
order by processed_dttm desc, key_hash, is_pk;
|
|
102
|
+
|
|
103
|
+
/* extract key values only */
|
|
104
|
+
%let ds2=%upcase(work.%mf_getuniquename(prefix=mpsd_pks));
|
|
105
|
+
%local keyhash processed;
|
|
106
|
+
%let keyhash=%upcase(%mf_getuniquename(prefix=mpsdvar_keyhash));
|
|
107
|
+
%let processed=%upcase(%mf_getuniquename(prefix=mpsdvar_processed));
|
|
108
|
+
create table &ds2 as
|
|
109
|
+
select key_hash as &keyhash,
|
|
110
|
+
tgtvar_nm,
|
|
111
|
+
tgtvar_type,
|
|
112
|
+
coalescec(oldval_char,newval_char) as charval,
|
|
113
|
+
coalesce(oldval_num, newval_num) as numval,
|
|
114
|
+
processed_dttm as &processed
|
|
115
|
+
from &ds1
|
|
116
|
+
where is_pk=1
|
|
117
|
+
order by &keyhash, &processed;
|
|
118
|
+
|
|
119
|
+
/* grab pk values */
|
|
120
|
+
%local pk;
|
|
121
|
+
select distinct upcase(tgtvar_nm) into: pk separated by ' ' from &ds2;
|
|
122
|
+
|
|
123
|
+
%let ds3=%upcase(work.%mf_getuniquename(prefix=mpsd_keychar));
|
|
124
|
+
proc transpose data=&ds2(where=(tgtvar_type='C'))
|
|
125
|
+
out=&ds3(drop=_name_);
|
|
126
|
+
by &keyhash &processed;
|
|
127
|
+
id TGTVAR_NM;
|
|
128
|
+
var charval;
|
|
129
|
+
run;
|
|
130
|
+
|
|
131
|
+
%let ds4=%upcase(work.%mf_getuniquename(prefix=mpsd_keynum));
|
|
132
|
+
proc transpose data=&ds2(where=(tgtvar_type='N'))
|
|
133
|
+
out=&ds4(drop=_name_);
|
|
134
|
+
by &keyhash &processed;
|
|
135
|
+
id TGTVAR_NM;
|
|
136
|
+
var numval;
|
|
137
|
+
run;
|
|
138
|
+
/* shorten the lengths */
|
|
139
|
+
%mp_ds2squeeze(&ds3,outds=&ds3)
|
|
140
|
+
%mp_ds2squeeze(&ds4,outds=&ds4)
|
|
141
|
+
|
|
142
|
+
/* now merge to get all key values and de-dup */
|
|
143
|
+
%let ds5=%upcase(work.%mf_getuniquename(prefix=mpsd_merged));
|
|
144
|
+
data &ds5;
|
|
145
|
+
length &keyhash $32 &processed 8;
|
|
146
|
+
merge &ds3 &ds4;
|
|
147
|
+
by &keyhash &processed;
|
|
148
|
+
if not missing(&keyhash);
|
|
149
|
+
run;
|
|
150
|
+
proc sort data=&ds5 nodupkey;
|
|
151
|
+
by &pk;
|
|
152
|
+
run;
|
|
153
|
+
|
|
154
|
+
/* join to base table for preliminary stage DS */
|
|
155
|
+
proc sql;
|
|
156
|
+
create table &outds as select "No " as _____DELETE__THIS__RECORD_____
|
|
157
|
+
%do x=1 %to %sysfunc(countw(&pk,%str( )));
|
|
158
|
+
,a.%scan(&pk,&x,%str( ))
|
|
159
|
+
%end;
|
|
160
|
+
%local notpkcols;
|
|
161
|
+
%let notpkcols=%upcase(%mf_getvarlist(&libds));
|
|
162
|
+
%let notpkcols=%mf_wordsinstr1butnotstr2(str1=¬pkcols,str2=&pk);
|
|
163
|
+
%do x=1 %to %sysfunc(countw(¬pkcols,%str( )));
|
|
164
|
+
,b.%scan(¬pkcols,&x,%str( ))
|
|
165
|
+
%end;
|
|
166
|
+
from &ds5 a
|
|
167
|
+
left join &libds (where=(&filterstr)) b
|
|
168
|
+
on 1=1
|
|
169
|
+
%do x=1 %to %sysfunc(countw(&pk,%str( )));
|
|
170
|
+
and a.%scan(&pk,&x,%str( ))=b.%scan(&pk,&x,%str( ))
|
|
171
|
+
%end;
|
|
172
|
+
;
|
|
173
|
+
|
|
174
|
+
/* create SAS code to apply to stage_ds */
|
|
175
|
+
data _null_;
|
|
176
|
+
set &ds1;
|
|
177
|
+
file &fref1 lrecl=33000;
|
|
178
|
+
length charval $32767;
|
|
179
|
+
if _n_=1 then put 'proc sql noprint;';
|
|
180
|
+
by descending processed_dttm key_hash is_pk;
|
|
181
|
+
if move_type='M' then do;
|
|
182
|
+
if first.key_hash then do;
|
|
183
|
+
put "update &outds set " @@;
|
|
184
|
+
end;
|
|
185
|
+
if IS_PK=0 then do;
|
|
186
|
+
put " " tgtvar_nm '=' @@;
|
|
187
|
+
cnt=count(oldval_char,'"');
|
|
188
|
+
charval=quote(trim(substr(oldval_char,1,32765-cnt)));
|
|
189
|
+
if tgtvar_type='C' then put charval @@;
|
|
190
|
+
else put oldval_num @@;
|
|
191
|
+
if not last.is_pk then put ',';
|
|
192
|
+
end;
|
|
193
|
+
else do;
|
|
194
|
+
if first.is_pk then put " where 1=1 " @@;
|
|
195
|
+
put " and " tgtvar_nm '=' @@;
|
|
196
|
+
cnt=count(oldval_char,'"');
|
|
197
|
+
charval=quote(trim(substr(oldval_char,1,32765-cnt)));
|
|
198
|
+
if tgtvar_type='C' then put charval @@;
|
|
199
|
+
else put oldval_num @@;
|
|
200
|
+
end;
|
|
201
|
+
end;
|
|
202
|
+
else if move_type='A' then do;
|
|
203
|
+
if first.key_hash then do;
|
|
204
|
+
put "update &outds set _____DELETE__THIS__RECORD_____='Yes' where 1=1 "@@;
|
|
205
|
+
end;
|
|
206
|
+
/* gating if - as only need PK now */
|
|
207
|
+
if is_pk=1;
|
|
208
|
+
put ' AND ' tgtvar_nm '=' @@;
|
|
209
|
+
cnt=count(newval_char,'"');
|
|
210
|
+
charval=quote(trim(substr(newval_char,1,32765-cnt)));
|
|
211
|
+
if tgtvar_type='C' then put charval @@;
|
|
212
|
+
else put newval_num @@;
|
|
213
|
+
end;
|
|
214
|
+
else if move_type='D' then do;
|
|
215
|
+
if first.key_hash then do;
|
|
216
|
+
put "update &outds set _____DELETE__THIS__RECORD_____='No' " @@;
|
|
217
|
+
end;
|
|
218
|
+
if IS_PK=0 then do;
|
|
219
|
+
put " ," tgtvar_nm '=' @@;
|
|
220
|
+
cnt=count(oldval_char,'"');
|
|
221
|
+
charval=quote(trim(substr(oldval_char,1,32765-cnt)));
|
|
222
|
+
if tgtvar_type='C' then put charval @@;
|
|
223
|
+
else put oldval_num @@;
|
|
224
|
+
end;
|
|
225
|
+
else do;
|
|
226
|
+
if first.is_pk then put " where 1=1 " @@;
|
|
227
|
+
put " and " tgtvar_nm '=' @@;
|
|
228
|
+
cnt=count(oldval_char,'"');
|
|
229
|
+
charval=quote(trim(substr(oldval_char,1,32765-cnt)));
|
|
230
|
+
if tgtvar_type='C' then put charval @@;
|
|
231
|
+
else put oldval_num @@;
|
|
232
|
+
end;
|
|
233
|
+
end;
|
|
234
|
+
if last.key_hash then put ';';
|
|
235
|
+
run;
|
|
236
|
+
|
|
237
|
+
/* apply the modification statements */
|
|
238
|
+
%inc &fref1/source2 lrecl=33000;
|
|
239
|
+
|
|
240
|
+
%if &mdebug=0 %then %do;
|
|
241
|
+
proc sql;
|
|
242
|
+
drop table &ds1, &ds2, &ds3, &ds4, &ds5;
|
|
243
|
+
file &fref1 clear;
|
|
244
|
+
%end;
|
|
245
|
+
%else %do;
|
|
246
|
+
data _null_;
|
|
247
|
+
infile &fref1;
|
|
248
|
+
input;
|
|
249
|
+
if _n_=1 then putlog "Contents of SQL adjustments";
|
|
250
|
+
putlog _infile_;
|
|
251
|
+
run;
|
|
252
|
+
%end;
|
|
253
|
+
|
|
254
|
+
%mend mp_stripdiffs;
|
|
255
|
+
/** @endcond */
|
package/macros/mp_testjob.sas
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
duration=60*5
|
|
9
9
|
)
|
|
10
10
|
|
|
11
|
-
@param [in] duration=
|
|
12
|
-
|
|
11
|
+
@param [in] duration= (30) The time in seconds which the job should run for.
|
|
12
|
+
Actual time may vary, as the check is done in between steps.
|
|
13
13
|
|
|
14
14
|
<h4> SAS Macros </h4>
|
|
15
15
|
@li mf_getuniquelibref.sas
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
,outds=work.results
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
-
@param lib= (WORK) The library in which to create the table
|
|
15
|
-
@param size= (0.1) The size in GB of the table to create
|
|
16
|
-
@param outds= (WORK.RESULTS) The output dataset to be created.
|
|
14
|
+
@param [in] lib= (WORK) The library in which to create the table
|
|
15
|
+
@param [in] size= (0.1) The size in GB of the table to create
|
|
16
|
+
@param [out] outds= (WORK.RESULTS) The output dataset to be created.
|
|
17
17
|
|
|
18
18
|
<h4> SAS Macros </h4>
|
|
19
19
|
@li mf_getuniquename.sas
|
package/macros/mp_tree.sas
CHANGED
|
@@ -15,8 +15,8 @@ https://communities.sas.com/t5/SAS-Programming/listing-all-files-within-a-direct
|
|
|
15
15
|
https://communities.sas.com/t5/SAS-Programming/listing-all-files-of-all-types-from-all-subdirectories/m-p/334113/highlight/true#M75419
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
@param dir= Directory to be scanned
|
|
19
|
-
@param outds= Dataset to create
|
|
18
|
+
@param [in] dir= (/tmp) Directory to be scanned
|
|
19
|
+
@param [out] outds= (work.mp_tree) Dataset to create
|
|
20
20
|
|
|
21
21
|
@returns outds contains the following variables:
|
|
22
22
|
|
package/macros/mp_unzip.sas
CHANGED
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
%mp_unzip(ziploc="/some/file.zip",outdir=/some/folder)
|
|
15
15
|
|
|
16
|
-
More info:
|
|
16
|
+
More info:
|
|
17
|
+
https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/
|
|
17
18
|
|
|
18
|
-
@param ziploc= Fileref or quoted full path
|
|
19
|
-
@param outdir= (%sysfunc(pathname(work))) Directory in which to write
|
|
20
|
-
outputs (created if
|
|
19
|
+
@param [in] ziploc= Fileref or quoted full path, eg: "/path/to/file.zip"
|
|
20
|
+
@param [out] outdir= (%sysfunc(pathname(work))) Directory in which to write
|
|
21
|
+
the outputs (created if needed)
|
|
21
22
|
|
|
22
23
|
<h4> SAS Macros </h4>
|
|
23
24
|
@li mf_mkdir.sas
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
proc sql;
|
|
15
15
|
describe table example;
|
|
16
16
|
|
|
17
|
-
@param libds the library.dataset to be modified
|
|
18
|
-
@param var The variable to modify
|
|
19
|
-
@param len The new length to apply
|
|
17
|
+
@param [in] libds the library.dataset to be modified
|
|
18
|
+
@param [in] var The variable to modify
|
|
19
|
+
@param [in] len The new length to apply
|
|
20
20
|
|
|
21
21
|
<h4> SAS Macros </h4>
|
|
22
22
|
@li mf_existds.sas
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
%end;
|
|
58
58
|
%else %if &rule=ISNUM %then %do;
|
|
59
59
|
/*
|
|
60
|
-
credit
|
|
60
|
+
credit SOREN LASSEN
|
|
61
61
|
https://sasmacro.blogspot.com/2009/06/welcome-isnum-macro.html
|
|
62
62
|
*/
|
|
63
63
|
&tempcol=input(&incol,?? best32.);
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
retain &tempcol;
|
|
72
72
|
&tempcol=prxparse('/^[_a-z]\w{0,7}\.[_a-z]\w{0,31}$/i');
|
|
73
73
|
if missing(&tempcol) then do;
|
|
74
|
-
putlog
|
|
74
|
+
putlog 'ERR' +(-1) "OR: Invalid expression for LIBDS";
|
|
75
75
|
stop;
|
|
76
76
|
end;
|
|
77
77
|
drop &tempcol;
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
retain &tempcol;
|
|
86
86
|
&tempcol=prxparse('/^[_a-z\$]\w{0,31}\.[0-9]*$/i');
|
|
87
87
|
if missing(&tempcol) then do;
|
|
88
|
-
putlog
|
|
88
|
+
putlog 'ERR' +(-1) "OR: Invalid expression for FORMAT";
|
|
89
89
|
stop;
|
|
90
90
|
end;
|
|
91
91
|
drop &tempcol;
|
package/macros/mp_wait4file.sas
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@param [in] file The file to wait for. Must be provided.
|
|
12
12
|
@param [in] maxwait= (0) Number of seconds to wait. If set to zero, will
|
|
13
13
|
loop indefinitely (to a maximum of 46 days, per SAS [documentation](
|
|
14
|
-
|
|
14
|
+
https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001418809.htm
|
|
15
15
|
)). Otherwise, execution will proceed upon sleep expiry.
|
|
16
16
|
@param [in] interval= (1) The wait period between sleeps, in seconds
|
|
17
17
|
|
package/macros/mp_webin.sas
CHANGED
package/macros/mp_zip.sas
CHANGED
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
<h4> SAS Macros </h4>
|
|
16
16
|
@li mp_dirlist.sas
|
|
17
17
|
|
|
18
|
-
@param in= unquoted filepath, dataset of files or directory to zip
|
|
19
|
-
@param type= (FILE) Valid values:
|
|
18
|
+
@param [in] in= unquoted filepath, dataset of files or directory to zip
|
|
19
|
+
@param [in] type= (FILE) Valid values:
|
|
20
20
|
@li FILE - /full/path/and/filename.extension to a particular file
|
|
21
21
|
@li DATASET - a dataset containing a list of files to zip (see `incol`)
|
|
22
22
|
@li DIRECTORY - a directory to zip
|
|
23
|
-
@param outname= (FILE) Output file to create, _without_ .zip extension
|
|
24
|
-
@param outpath= (%sysfunc(pathname(WORK))) Parent folder for
|
|
25
|
-
@param incol=
|
|
23
|
+
@param [out] outname= (FILE) Output file to create, _without_ .zip extension
|
|
24
|
+
@param [out] outpath= (%sysfunc(pathname(WORK))) Parent folder for zip file
|
|
25
|
+
@param [in] incol= () If DATASET input, say which column contains the filepath
|
|
26
26
|
|
|
27
27
|
<h4> Related Macros </h4>
|
|
28
28
|
@li mp_unzip.sas
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"nodeVersionMessage": "echo \u001b[33m make sure you are running node lts version \u001b[0m",
|
|
15
15
|
"preinstall": "npm run nodeVersionMessage",
|
|
16
16
|
"prebuild": "npm run nodeVersionMessage",
|
|
17
|
-
"build": "rimraf build && tsc",
|
|
17
|
+
"build": "npx rimraf build && tsc",
|
|
18
18
|
"postbuild": "npm run copy:macros",
|
|
19
19
|
"copy:macros": "ts-node ./scripts/copySASjsCore.ts",
|
|
20
20
|
"prepublishOnly": "cp -r ./build/* . && rm -rf ./build && rm -rf ./src && rm jest.config.js && rm tsconfig.json",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/sasjs/utils#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@sasjs/core": "
|
|
39
|
+
"@sasjs/core": "4.54.0",
|
|
40
40
|
"@types/cli-table": "0.3.0",
|
|
41
41
|
"@types/find": "0.2.1",
|
|
42
42
|
"@types/jest": "29.4.0",
|
|
@@ -51,17 +51,16 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@fast-csv/format": "4.3.5",
|
|
54
|
-
"@types/fs-extra": "
|
|
54
|
+
"@types/fs-extra": "11.0.4",
|
|
55
55
|
"@types/prompts": "2.0.13",
|
|
56
56
|
"chalk": "4.1.1",
|
|
57
57
|
"cli-table": "0.3.6",
|
|
58
58
|
"consola": "2.15.0",
|
|
59
59
|
"find": "0.3.0",
|
|
60
|
-
"fs-extra": "
|
|
60
|
+
"fs-extra": "11.3.0",
|
|
61
61
|
"jwt-decode": "3.1.2",
|
|
62
62
|
"prompts": "2.4.1",
|
|
63
|
-
"rimraf": "5.0.10",
|
|
64
63
|
"valid-url": "1.0.9"
|
|
65
64
|
},
|
|
66
|
-
"version": "3.5.
|
|
65
|
+
"version": "3.5.2"
|
|
67
66
|
}
|