Looks to me you want the log messages of the sas jobs and not the LSF log. This might just do what you wanted. It captures all the existing logs of sas jobs submitted by LSF (including lsf flowname) and creates a dataset sasuser.errors with the jobname logdate and error lines You'll have to change things for unix yourself Hope this helps %let SASplatform = d:\SASPLF\; %let OTAPLevel = lev1; %let SERVER = ETL; %let LogDir = BatchServer\logs\; /********************************************************************* * Get the names of the logfiles *********************************************************************/ filename dirlist pipe "dir &SASplatform.GNL&server.\&otaplevel.\SAS&server.\&logdir.*.log"; data sasuser.logfiles(keep=lognaam); length tekst $200 lognaam $120 process $100; infile dirlist truncover; input tekst $char200.; lognaam = "&SASplatform.SAS&server.\&otaplevel.\SAS&server.\&logdir"||scan(tekst,5,' '); if index(lognaam,'.log') then output; run; /*************************************************************** * read the logfiles and extract the errors ***************************************************************/ data sasuser.errors(keep=process logdatum line); set sasuser.logfiles; length line $200; format datetime datetime 21.2; process = scan(scan(lognaam,1,'200'),8,"\"); process = substr(process,1,length(process)-1); logdatum = scan(lognaam,-2,'_'); infile dummy missover truncover end=end length=len filevar=lognaam; retain process; do until(end); input line $200.; line = left(line); if index(upcase(line),'ERROR:')= 1 then do; * starttime = input(scan(line,10,' '),?? time8.); * startdate = input(scan(line,2,','),date12.); * start = dhms(startdatum,0,0,starttijd); output sasuser.errors; end; end; /* end of do until step */ run;
... View more