but this isn't exactly what i mean..
From log file is a text like this :
line 2000 NOTE: The SAS System stopped processing this step because of errors.
line 2001 NOTE: SAS set option OBS=0 and will continue to check statements.
line 2002 This may cause NOTE: No observations in data set.
line 2003 WARNING: The data set WORK.DATA may be incomplete.
line 2004 When this step was stopped there were 0
line 2005 observations and 0 variables.
so.. i have 2 lines contain word 'STOP'
Beware that you may not always find a consistent line-numbering "experience" with SAS, unfortunately. However, with very basic SAS program executions, you should find the SAS "line number" followed by the respective code for that line.
My recommendation is to read the log file, a line at a time, parsing it for a line number, followed by some remaining text (to be either a "note", "error", or maybe SAS code.
This kind of thing is a straightforward requirement, so it should be easy.
Infile option line= helps.[pre]data stops( keep= row line ) ;
do until( end_of_data ) ;
infile 'your log file' line= rowNum scanover ;
input @'STOP' @ ;
row= rowNum ; * variables named by statement options cannot be kept;
length line $256 ;
line= _infile_ ;
input ; * release current line ;
run ;[/pre]What introduces a difficulty is that the line= information seems to be reset at each data step iteration, so you have to avoid that by coding your own iteration (like that demo above).