Hi, Here's another approach. A combination of the examples in the doc for call prxnext and call prxposn. I haven't counted occurrences of </Rect[...] in the source file, so I leave it to you to further check if this output is correct. HTH, Scott P.S.: Good tip from re: termstr=cr! filename in "C:\Temp\blankcrf.fdf"; data test; infile in lrecl=32767 length=reclen termstr=cr; input; rx=prxparse("#</Rect\[(.*?)\]#io"); start=1; stop=reclen; call prxnext(rx, start, stop, _infile_, position, length); do while (position > 0); call prxposn(rx, 1, start, length); found=substr(_infile_,start,length); * put found= position= length= reclen=; output; call prxnext(rx, start, stop, _infile_, position, length); end; run; Here's an excerpt from the log. If you see maximum record length >= 32767 or a truncated record message be worried. Which you get without the termstr=cr infile option. NOTE: The infile IN is: Filename=C:\Temp\blankcrf.fdf, RECFM=V,LRECL=32767,File Size (bytes)=667689, Last Modified=04 February 2014 17:39:46, Create Time=04 February 2014 17:39:46 NOTE: 4689 records were read from the infile IN. The minimum record length was 1. The maximum record length was 8763. NOTE: The data set WORK.TEST has 1019 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.08 seconds cpu time 0.07 seconds
... View more