@sasjs/core 4.22.0 → 4.23.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.
@@ -0,0 +1,42 @@
1
+ /**
2
+ @file
3
+ @brief Returns E8601DT26.6 if compatible else DATETIME19.3
4
+ @details From our experience in [Data Controller for SAS]
5
+ (https://datacontroller.io) deployments, the E8601DT26.6 datetime format has
6
+ the widest support when it comes to pass-through SQL queries.
7
+
8
+ However, it is not supported in WPS or early versions of SAS 9 (M3 and below)
9
+ when used as a datetime literal, eg:
10
+
11
+ data _null_;
12
+ demo="%sysfunc(datetime(),E8601DT26.6)"dt;
13
+ demo=;
14
+ run;
15
+
16
+ This macro will therefore return DATEITME19.3 as an alternative format
17
+ based on the runtime environment so that it can be used in such cases, eg:
18
+
19
+ data _null_;
20
+ demo="%sysfunc(datetime(),%mf_fmtdttm())"dt;
21
+ demo=;
22
+ run;
23
+
24
+ <h4> Related Macros </h4>
25
+ @li mf_fmtdttm.test.sas
26
+
27
+ @author Allan Bowe
28
+ **/
29
+
30
+ %macro mf_fmtdttm(
31
+ )/*/STORE SOURCE*/;
32
+
33
+ %if "&sysver"="9.2" or "&sysver"="9.3"
34
+ or ("&sysver"="9.4" and "%substr(&SYSVLONG,9,1)" le "3")
35
+ or "%substr(&sysver,1,1)"="4"
36
+ or "%substr(&sysver,1,1)"="5"
37
+ %then %do;DATETIME19.3%end;
38
+ %else %do;E8601DT26.6%end;
39
+
40
+ %mend mf_fmtdttm;
41
+
42
+
@@ -22,6 +22,7 @@
22
22
  @param [in] loop_secs= (1) Seconds to wait between each lock attempt
23
23
 
24
24
  <h4> SAS Macros </h4>
25
+ @li mf_fmtdttm.sas
25
26
  @li mp_abort.sas
26
27
  @li mp_lockfilecheck.sas
27
28
  @li mf_getuser.sas
@@ -111,7 +112,7 @@ run;
111
112
  LOCK_LIB ="&lib";
112
113
  LOCK_DS="&ds";
113
114
  LOCK_STATUS_CD='LOCKED';
114
- LOCK_START_DTTM="%sysfunc(datetime(),E8601DT26.6)"dt;
115
+ LOCK_START_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt;
115
116
  LOCK_USER_NM="&user";
116
117
  LOCK_PID="&sysjobid";
117
118
  LOCK_REF="&ref";
@@ -131,7 +132,7 @@ run;
131
132
  proc sql;
132
133
  update &ctl_ds
133
134
  set LOCK_STATUS_CD='LOCKED'
134
- , LOCK_START_DTTM="%sysfunc(datetime(),E8601DT26.6)"dt
135
+ , LOCK_START_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
135
136
  , LOCK_USER_NM="&user"
136
137
  , LOCK_PID="&sysjobid"
137
138
  , LOCK_REF="&ref"
@@ -206,7 +207,7 @@ run;
206
207
  proc sql;
207
208
  update &ctl_ds
208
209
  set LOCK_STATUS_CD='UNLOCKED'
209
- , LOCK_END_DTTM="%sysfunc(datetime(),E8601DT26.6)"dt
210
+ , LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
210
211
  , LOCK_USER_NM="&user"
211
212
  , LOCK_PID="&sysjobid"
212
213
  , LOCK_REF="&ref"
@@ -58,6 +58,7 @@
58
58
 
59
59
  <h4> SAS Macros </h4>
60
60
  @li mf_existvar.sas
61
+ @li mf_fmtdttm.sas
61
62
  @li mf_getquotedstr.sas
62
63
  @li mf_getuniquename.sas
63
64
  @li mf_nobs.sas
@@ -217,12 +218,12 @@ quit;
217
218
  set keytable="&base_libds"
218
219
  ,keycolumn="&retained_key"
219
220
  ,max_key=%eval(&maxkey+&newkey_cnt)
220
- ,processed_dttm="%sysfunc(datetime(),E8601DT26.6)"dt;
221
+ ,processed_dttm="%sysfunc(datetime(),%mf_fmtdttm())"dt;
221
222
  %end;
222
223
  %else %do;
223
224
  update &maxkeytable
224
225
  set max_key=%eval(&maxkey+&newkey_cnt)
225
- ,processed_dttm="%sysfunc(datetime(),E8601DT26.6)"dt
226
+ ,processed_dttm="%sysfunc(datetime(),%mf_fmtdttm())"dt
226
227
  where keytable="&base_libds";
227
228
  %end;
228
229
  %mp_lockanytable(UNLOCK
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.22.0"
38
+ "version": "4.23.0"
39
39
  }