data _null_; infile datalines truncover; if _N_=1 then pattern=prxparse("/ERROR:|message/"); retain pattern; input test $80.; position=PRXMATCH(pattern,test); put test= position=; datalines; NOTE: One or more lines were truncated. Error: This is a home-made error message using lowercase. ERROR: SAS stopped processing due to errors. ERROR 180-322: Statement used out of order. ERROR 22-7: Invalid option name S. ERROR: Libname _IMEX_ is not assigned.