Hey Folks!  I love the scanner program but i too written a  similar piece of program to find any pattern from a log file or sas program.     You can mention a wild card characters (*) in datalines to search in multiple files or sas codes.     Hope this will helps!  Learn Together !  Grow together !     Here's my program:     data code;     length fileloc myinfile $ 512 Log_file_name $100. ;     input fileloc $ ;        infile dummy filevar=fileloc             filename=myinfile end=eof LRECL=512 truncover dsd ;      do while(not eof);       input  ;  linenum + 1;  if index(_infile_, 'ERROR') then output;  Log_file_name=myinfile;     end;     put 'Finished reading ' myinfile=;      datalines;   &logdir./&filename.  /*Your log filename here including directory  -  Ex : /work/prod/outputfile*.log */  ;  run; 
						
					
					... View more