@sasjs/core 7.1.1 → 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.
- package/base/mp_filtervalidate.sas +19 -3
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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=%
|
|
114
|
+
msg=%superq(flt_msg)
|
|
99
115
|
)
|
|
100
116
|
%end;
|
|
101
117
|
%let syscc=1008;
|
package/package.json
CHANGED