1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 14:04:36 +00:00

fix: mac var and chop point issue in mp_chop.sas

This commit is contained in:
munja
2022-04-28 19:20:03 +01:00
parent 099a5f7840
commit 42f2767129

View File

@@ -62,6 +62,7 @@
@li mf_getuniquename.sas
<h4> Related Macros </h4>
@li mp_abort.sas
@li mp_gsubfile.sas
@li mp_replace.sas
@li mp_chop.test.sas
@@ -87,6 +88,11 @@
%if &outfile=0 %then %let outfile=&infile;
%mp_abort(iftrue= (%length(%superq(&matchvar))=0)
,mac=mp_chop.sas
,msg=%str(&matchvar is an empty variable)
)
/* START */
%let dttm=%sysfunc(datetime());
@@ -148,10 +154,14 @@ data _null_;
else if "&keep"='LAST' then mp=stop;
end;
split=mp+&offset;
call symputx('split',split);
call symputx('split',split,'l');
%if &mdebug=1 %then %do;
put (_all_)(=);
%put &=offset;
%end;
run;
%if &split=0 %then %do;
%put &sysmacroname: No match found in &inref for string %superq(matchvar);
%put &sysmacroname: No match found in &infile for string %superq(&matchvar);
%return;
%end;
@@ -172,7 +182,7 @@ run;
%end;
%else %do;
data _null_;
infile &infile lrecl=32767;
infile &outfile lrecl=32767;
input;
list;
if _n_>50 then stop;