As I appreciate the help of the community members, I would like to share the following code: %macro LogFile_RealTime(Dir1= , LogFileName =, Minimum_Time= ); data x; /* build SAS dataset */ rownum=_n_; infile "&Dir1\&LogFileName" truncover ; /* raw file in */ input @1 Texte $120.; /* read a record */ run; Data Table1; set x; if substr(Texte,1,5) eq 'NOTE:' then output Table1; if substr(Texte,1,10) eq 'temps réel' then output Table1; if substr(Texte,1,8) eq 'temps UC' then output Table1; run; Data Table2; set x; if substr(Texte,1,15) eq 'NOTE: PROCEDURE' then output Table2; if substr(Texte,1,28) eq "NOTE: L'étape DATA a utilisé" then output Table2; if substr(Texte,1,10) eq 'temps réel' then DO; Temps=compress(upcase(texte),'ABCDEFGHIJKLMNOPQRSTUVWXYZÉ'); output Table2; END; if substr(Texte,1,8) eq 'temps UC' then DO; Temps=compress(upcase(texte),'ABCDEFGHIJKLMNOPQRSTUVWXYZÉ'); output Table2; END; run; Data Table3; set Table2; Temps1=put(compress(Temps),$12.); stimer=input(Temps1,stimer12.); run; %macro obscnt(dsn=); %global nobs dsnid; %let nobs=.; %* Open the data set of interest; %let dsnid = %sysfunc(open(&dsn)); %* If the open was successful get the; %* number of observations and CLOSE &dsn; %if &dsnid %then %do; %let nobs=%sysfunc(attrn(&dsnid,nlobs)); %let rc =%sysfunc(close(&dsnid)); %end; %else %do; %put Unable to open &dsn - %sysfunc(sysmsg()); %end; %* Return the number of observations; %mend obscnt; %obscnt(dsn=Table3); %put &nobs; Data Table4 (keep= rownum texte); set Table3; do i=1 to &nobs by 3; Temp1=i+1; Temp2=i+2; if _n_ = Temp1 then delete; if _n_ = Temp2 then delete; end; run; Data Table5(keep= rownum temps1 stimer rename=stimer=Temps_Réel rename=temps1=Temps_Réel_txt); set Table3; do i=1 to &nobs by 3; Temp1=i+1; Temp2=i+2; if _n_ = Temp1-1 then delete; if _n_ = Temp2 then delete; end; run; Data Table6(keep= rownum temps1 stimer rename=stimer=temps_CPU rename=temps1=Temps_CPU_txt); set Table3; do i=1 to &nobs by 3; Temp1=i+1; Temp2=i+2; if _n_ = Temp1-1 then delete; if _n_ = Temp1 then delete; end; run; Data global; merge Table4 Table5 Table6; run; proc sort data=global out=rapport; by descending temps_réel; run; Data rapport; set rapport; where temps_réel >= &Minimum_Time; run; %mend LogFile_RealTime; %LogFile_RealTime(Dir1=c:\user\LePage , LogFileName=test.log, Minimum_Time= 100); Regards, ALP
... View more