Thank you. I couldn't find it successfully by searching in Community, but I should have googled it first.
In addition, when I tried it in my environment, there was a case where it failed.
When I submitted proc options in a Japanese environment, there was a case where it started with a space followed by a number like this.
I think this is a rare case, but assuming the above, I built it as follows.
data _null_;
length f $1 i $10;
infile logfile;
file cleaned;
input;
f=subpad(_infile_,1,1);
i=trim(scan(_infile_,1,' '));
if input(f,??best.) and
input(i,??best.) then do;
firstblank=length(i)+1;
substr(_infile_,1,firstblank-1)='';
end;
put _infile_;
run;
It took an extra 20% of processing time, but it took just over a second when I tested it on a log of 1.72 million lines, so it was well within the acceptable range.
... View more