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:
@@ -62,6 +62,7 @@
|
|||||||
@li mf_getuniquename.sas
|
@li mf_getuniquename.sas
|
||||||
|
|
||||||
<h4> Related Macros </h4>
|
<h4> Related Macros </h4>
|
||||||
|
@li mp_abort.sas
|
||||||
@li mp_gsubfile.sas
|
@li mp_gsubfile.sas
|
||||||
@li mp_replace.sas
|
@li mp_replace.sas
|
||||||
@li mp_chop.test.sas
|
@li mp_chop.test.sas
|
||||||
@@ -87,6 +88,11 @@
|
|||||||
|
|
||||||
%if &outfile=0 %then %let outfile=&infile;
|
%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 */
|
/* START */
|
||||||
%let dttm=%sysfunc(datetime());
|
%let dttm=%sysfunc(datetime());
|
||||||
|
|
||||||
@@ -148,10 +154,14 @@ data _null_;
|
|||||||
else if "&keep"='LAST' then mp=stop;
|
else if "&keep"='LAST' then mp=stop;
|
||||||
end;
|
end;
|
||||||
split=mp+&offset;
|
split=mp+&offset;
|
||||||
call symputx('split',split);
|
call symputx('split',split,'l');
|
||||||
|
%if &mdebug=1 %then %do;
|
||||||
|
put (_all_)(=);
|
||||||
|
%put &=offset;
|
||||||
|
%end;
|
||||||
run;
|
run;
|
||||||
%if &split=0 %then %do;
|
%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;
|
%return;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
@@ -172,7 +182,7 @@ run;
|
|||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
infile &infile lrecl=32767;
|
infile &outfile lrecl=32767;
|
||||||
input;
|
input;
|
||||||
list;
|
list;
|
||||||
if _n_>50 then stop;
|
if _n_>50 then stop;
|
||||||
|
|||||||
Reference in New Issue
Block a user