@sasjs/core 5.7.0 → 5.7.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.
@@ -148,7 +148,10 @@ run;
148
148
 
149
149
  data work.&ds_cfg.;
150
150
  set &control;
151
- %if "&where" ne "0" and %length(&where)>0 %then %do;
151
+ /* %superq, because a filter can legitimately contain quotes - a datetime
152
+ literal such as "21OCT2026:09:00:00"dt is the usual case, and quoting it
153
+ again inside a %if condition breaks the evaluation */
154
+ %if %superq(where) ne 0 %then %do;
152
155
  where &where;
153
156
  %end;
154
157
  where also upcase(libref)="%upcase(%scan(&libds,1,.))"
@@ -315,58 +318,64 @@ create table work.&ds_self. as
315
318
  where name=dep_nm;
316
319
  quit;
317
320
 
318
- %if %mf_nobs(work.&ds_baddep.)>0 %then %do;
319
- data _null_;
320
- set work.&ds_baddep.(obs=1);
321
- call symputx('derived_err'
322
- ,cats(name,': VAR_DEPS lists ',dep_nm
323
- ,', which is not a column of the table or a derived variable'));
324
- run;
325
- %mp_abort(iftrue=1,mac=&sysmacroname,msg=%superq(derived_err))
326
- %end;
321
+ data _null_;
322
+ set work.&ds_baddep.(obs=1);
323
+ call symputx('derived_err'
324
+ ,cats(name,': VAR_DEPS lists ',dep_nm
325
+ ,', which is not a column of the table or a derived variable'));
326
+ run;
327
327
 
328
- %if %mf_nobs(work.&ds_self.)>0 %then %do;
329
- data _null_;
330
- set work.&ds_self.(obs=1);
331
- call symputx('derived_err',cats(name,': VAR_DEPS may not list itself'));
332
- run;
333
- %mp_abort(iftrue=1,mac=&sysmacroname,msg=%superq(derived_err))
334
- %end;
328
+ %mp_abort(iftrue= (0 < %mf_nobs(work.&ds_baddep.))
329
+ ,mac=&sysmacroname
330
+ ,msg=%superq(derived_err)
331
+ )
335
332
 
336
- %if %mf_nobs(work.&ds_undecl.)>0 %then %do;
337
- data _null_;
338
- set work.&ds_undecl.(obs=1);
339
- call symputx('derived_err'
340
- ,cats(name,': VAR_LOGIC references ',dep_nm
341
- ,', which is not in VAR_DEPS'));
342
- run;
343
- %mp_abort(iftrue=1,mac=&sysmacroname,msg=%superq(derived_err))
344
- %end;
333
+ data _null_;
334
+ set work.&ds_self.(obs=1);
335
+ call symputx('derived_err',cats(name,': VAR_DEPS may not list itself'));
336
+ run;
345
337
 
346
- %if %mf_nobs(work.&ds_stale.)>0 %then %do;
347
- data _null_;
348
- set work.&ds_stale.(obs=1);
349
- call symputx('derived_err'
350
- ,cats(name,': VAR_DEPS lists ',dep_nm
351
- ,', which VAR_LOGIC does not reference'));
352
- run;
353
- %mp_abort(iftrue=1,mac=&sysmacroname,msg=%superq(derived_err))
354
- %end;
338
+ %mp_abort(iftrue= (0 < %mf_nobs(work.&ds_self.))
339
+ ,mac=&sysmacroname
340
+ ,msg=%superq(derived_err)
341
+ )
355
342
 
356
- %if %mf_nobs(work.&ds_bad.)>0 %then %do;
357
- data _null_;
358
- set work.&ds_bad.;
359
- putlog 'ERR' 'OR: derived variable config: ' name= reason=;
360
- run;
361
- data _null_;
362
- set work.&ds_bad.(obs=1);
363
- call symputx('derived_err',cats(name,': ',reason));
364
- run;
365
- %mp_abort(iftrue=1
366
- ,mac=&sysmacroname
367
- ,msg=%str(Invalid derived variable configuration - &derived_err)
368
- )
369
- %end;
343
+ data _null_;
344
+ set work.&ds_undecl.(obs=1);
345
+ call symputx('derived_err'
346
+ ,cats(name,': VAR_LOGIC references ',dep_nm
347
+ ,', which is not in VAR_DEPS'));
348
+ run;
349
+
350
+ %mp_abort(iftrue= (0 < %mf_nobs(work.&ds_undecl.))
351
+ ,mac=&sysmacroname
352
+ ,msg=%superq(derived_err)
353
+ )
354
+
355
+ data _null_;
356
+ set work.&ds_stale.(obs=1);
357
+ call symputx('derived_err'
358
+ ,cats(name,': VAR_DEPS lists ',dep_nm
359
+ ,', which VAR_LOGIC does not reference'));
360
+ run;
361
+
362
+ %mp_abort(iftrue= (0 < %mf_nobs(work.&ds_stale.))
363
+ ,mac=&sysmacroname
364
+ ,msg=%superq(derived_err)
365
+ )
366
+
367
+ data _null_;
368
+ set work.&ds_bad.;
369
+ putlog 'ERR' 'OR: derived variable config: ' name= reason=;
370
+ run;
371
+ data _null_;
372
+ set work.&ds_bad.(obs=1);
373
+ call symputx('derived_err',cats(name,': ',reason));
374
+ run;
375
+ %mp_abort(iftrue= (0 < %mf_nobs(work.&ds_bad.))
376
+ ,mac=&sysmacroname
377
+ ,msg=%str(Invalid derived variable configuration - &derived_err)
378
+ )
370
379
 
371
380
  /**
372
381
  * Dependency order. The edges are between derived variables only - a
@@ -394,6 +403,7 @@ run;
394
403
 
395
404
  %let left=%mf_nobs(work.&ds_todo.);
396
405
  %let nplaced=0;
406
+ %let cyc_found=0;
397
407
 
398
408
  %do %while (&left>0);
399
409
  proc sql;
@@ -437,30 +447,37 @@ run;
437
447
  %end;
438
448
  %end;
439
449
  %end;
440
- %mp_abort(iftrue=1
441
- ,mac=&sysmacroname
442
- ,msg=%str(VAR_DEPS contains a cycle: &cyc_path)
443
- )
450
+ /* leave the loop before aborting - an abort cancels the step, and the
451
+ loop would re-enter with the ready count still zero */
452
+ %let cyc_found=1;
453
+ %let left=0;
444
454
  %end;
445
455
 
446
- /* seq carries the dependency order - the placement rounds are not name
447
- ordered, so the final merge must not rely on by name alone */
448
- data work.&ds_ready.;
449
- set work.&ds_ready.;
450
- seq=_n_+&nplaced;
451
- run;
452
- proc append base=work.&ds_placed. data=work.&ds_ready. force;
453
- run;
454
- %let nplaced=%eval(&nplaced+&nready);
456
+ %if &cyc_found=0 %then %do;
457
+ /* seq carries the dependency order - the placement rounds are not name
458
+ ordered, so the final merge must not rely on by name alone */
459
+ data work.&ds_ready.;
460
+ set work.&ds_ready.;
461
+ seq=_n_+&nplaced;
462
+ run;
463
+ proc append base=work.&ds_placed. data=work.&ds_ready. force;
464
+ run;
465
+ %let nplaced=%eval(&nplaced+&nready);
455
466
 
456
- proc sql;
457
- delete from work.&ds_todo.
458
- where name in (select name from work.&ds_ready.);
459
- quit;
467
+ proc sql;
468
+ delete from work.&ds_todo.
469
+ where name in (select name from work.&ds_ready.);
470
+ quit;
460
471
 
461
- %let left=%mf_nobs(work.&ds_todo.);
472
+ %let left=%mf_nobs(work.&ds_todo.);
473
+ %end;
462
474
  %end;
463
475
 
476
+ %mp_abort(iftrue= (&cyc_found=1)
477
+ ,mac=&sysmacroname
478
+ ,msg=%str(VAR_DEPS contains a cycle: &cyc_path)
479
+ )
480
+
464
481
  proc sort data=work.&ds_placed.;
465
482
  by name;
466
483
  run;
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "@nogoo9/gitleaks": "8.30.1-post.2"
45
45
  },
46
- "version": "5.7.0"
46
+ "version": "5.7.2"
47
47
  }