@sasjs/core 4.32.12 → 4.32.13
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_filtercheck.sas +27 -12
- package/package.json +1 -1
package/base/mp_filtercheck.sas
CHANGED
|
@@ -92,7 +92,8 @@ data &outds;
|
|
|
92
92
|
/*length GROUP_LOGIC SUBGROUP_LOGIC $3 SUBGROUP_ID 8 VARIABLE_NM $32
|
|
93
93
|
OPERATOR_NM $10 RAW_VALUE $4000;*/
|
|
94
94
|
set &inds;
|
|
95
|
-
length reason_cd $4032 vtype $1 vnum dsid 8;
|
|
95
|
+
length reason_cd $4032 vtype $1 vnum dsid 8 tmp $4000;
|
|
96
|
+
drop tmp;
|
|
96
97
|
|
|
97
98
|
/* quick check to ensure column exists */
|
|
98
99
|
if upcase(VARIABLE_NM) not in
|
|
@@ -168,18 +169,32 @@ data &outds;
|
|
|
168
169
|
end;
|
|
169
170
|
|
|
170
171
|
/* special logic */
|
|
171
|
-
if OPERATOR_NM
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
172
|
+
if OPERATOR_NM in ('IN','NOT IN','BETWEEN') then do;
|
|
173
|
+
if OPERATOR_NM='BETWEEN' then raw_value1=tranwrd(raw_value,' AND ',',');
|
|
174
|
+
else do;
|
|
175
|
+
if substr(raw_value,1,1) ne '('
|
|
176
|
+
or substr(cats(reverse(raw_value)),1,1) ne ')'
|
|
177
|
+
then do;
|
|
178
|
+
REASON_CD='Missing start/end bracket in RAW_VALUE';
|
|
179
|
+
putlog REASON_CD= OPERATOR_NM= raw_value= raw_value1= ;
|
|
180
|
+
call symputx('reason_cd',reason_cd,'l');
|
|
181
|
+
call symputx('nobs',_n_,'l');
|
|
182
|
+
output;
|
|
183
|
+
end;
|
|
184
|
+
else raw_value1=substr(raw_value,2,max(length(raw_value)-2,0));
|
|
185
|
+
end;
|
|
186
|
+
/* we now have a comma seperated list of values */
|
|
187
|
+
if vtype='N' then do i=1 to countc(raw_value1, ',')+1;
|
|
188
|
+
tmp=scan(raw_value1,i,',');
|
|
189
|
+
if cats(tmp) ne '.' and input(tmp, ?? 8.) eq . then do;
|
|
190
|
+
REASON_CD='Non Numeric value provided';
|
|
191
|
+
putlog REASON_CD= OPERATOR_NM= raw_value= raw_value1= ;
|
|
192
|
+
call symputx('reason_cd',reason_cd,'l');
|
|
193
|
+
call symputx('nobs',_n_,'l');
|
|
194
|
+
output;
|
|
195
|
+
end;
|
|
196
|
+
return;
|
|
181
197
|
end;
|
|
182
|
-
else raw_value1=substr(raw_value,2,max(length(raw_value)-2,0));
|
|
183
198
|
end;
|
|
184
199
|
else raw_value1=raw_value;
|
|
185
200
|
|
package/package.json
CHANGED