@sasjs/core 7.1.0 → 7.1.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.
@@ -26,6 +26,8 @@
26
26
  %mp_filtervalidate(myfilter,sashelp.class)
27
27
 
28
28
  @returns The SYSCC value will be 1008 if there are validation issues.
29
+ On an abort the message carries the reason and the clause that failed, so
30
+ the inputs are visible without reading the log.
29
31
 
30
32
  @param [in] inref The input fileref to validate (generated by
31
33
  mp_filtergenerate.sas)
@@ -56,12 +58,14 @@
56
58
  ,msg=%str(syscc=&syscc / syserr=&syserr - on macro entry)
57
59
  )
58
60
 
59
- %local fref1;
61
+ %local fref1 flt_clause flt_msg;
60
62
  %let fref1=%mf_getuniquefileref();
61
63
 
62
64
  data _null_;
63
65
  file &fref1;
64
66
  infile &inref end=eof;
67
+ length flt_clause $4000;
68
+ retain flt_clause;
65
69
  if _n_=1 then do;
66
70
  put "proc sql;";
67
71
  put "validate select * from &targetds";
@@ -70,7 +74,13 @@ data _null_;
70
74
  input;
71
75
  put _infile_;
72
76
  putlog _infile_;
73
- if eof then put ";quit;";
77
+ /* the generated clause, kept so a failure can name the inputs it was given -
78
+ the SQL message reports only the clashing data types */
79
+ flt_clause=cats(flt_clause,ifc(_n_>1,' ',''),strip(_infile_));
80
+ if eof then do;
81
+ put ";quit;";
82
+ call symputx('flt_clause',flt_clause,'l');
83
+ end;
74
84
  run;
75
85
 
76
86
  %inc &fref1;
@@ -90,12 +100,18 @@ filename &fref1 clear;
90
100
  %if &abort=YES %then %do;
91
101
  data _null_;
92
102
  set &outds;
103
+ length flt_msg $4000;
93
104
  call symputx('REASON_CD',reason_cd,'l');
105
+ /* the clause is reported with the reason: the SQL message says which
106
+ types clashed but not which inputs produced it */
107
+ flt_msg=catx(' ','Filter validation issues:',reason_cd
108
+ ,catx(' ','Clause: where',symget('flt_clause')));
109
+ call symputx('flt_msg',flt_msg,'l');
94
110
  stop;
95
111
  run;
96
112
  %mp_abort(
97
113
  mac=&sysmacroname,
98
- msg=%str(Filter validation issues.)
114
+ msg=%superq(flt_msg)
99
115
  )
100
116
  %end;
101
117
  %let syscc=1008;
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "@nogoo9/gitleaks": "8.30.1-post.2"
45
45
  },
46
- "version": "7.1.0"
46
+ "version": "7.1.2"
47
47
  }
@@ -18,8 +18,8 @@
18
18
  ordinal_root num,
19
19
  ordinal_items num,
20
20
  version num,
21
- id char(43),
22
- name char(43),
21
+ id char(256),
22
+ name char(256),
23
23
  providerId char(5),
24
24
  implicit num
25
25
 
@@ -29,7 +29,11 @@
29
29
  @param [in] grant_type= (sas_services)
30
30
  valid values are "password" or "authorization_code" (unquoted).
31
31
  @param [out] outds= (work.viyagroupmembers)
32
- The library.dataset to be created that contains the list of group members
32
+ The library.dataset to be created that contains the list of members
33
+
34
+ id and name are declared at $256, the longest active directory can hold for
35
+ a display name or a SAM account name. The $43 they used to carry truncated
36
+ anything longer, and a truncation fails the step on some platforms.
33
37
 
34
38
 
35
39
  @version VIYA V.03.04
@@ -85,7 +89,7 @@ run;
85
89
  %if &SYS_PROCHTTP_STATUS_CODE=404 %then %do;
86
90
  %put NOTE: Group &group not found!!;
87
91
  data &outds;
88
- length id name $43;
92
+ length id name $256;
89
93
  call missing(of _all_);
90
94
  run;
91
95
  %end;
@@ -96,8 +100,14 @@ run;
96
100
  )
97
101
  %let libref1=%mf_getuniquelibref();
98
102
  libname &libref1 JSON fileref=&fname1;
103
+ /* id and name have to be declared, as a group with no members returns no
104
+ such columns to rename. $256 is the longest active directory can hold for
105
+ a display name or a SAM account name: the JSON engine sizes the columns to
106
+ the longest value in the payload, so a shorter declaration truncates the
107
+ name and fails the step with "Multiple lengths were specified for the
108
+ variable ... by input data set(s)". */
99
109
  data &outds;
100
- length id name $43;
110
+ length id name $256;
101
111
  set &libref1..items;
102
112
  run;
103
113
  libname &libref1 clear;