%let ApacheLogFile = c:\temp\apache.log; data ApacheLog; infile "&ApacheLogFile" lrecl=1000 end=end; rx = prxParse ('/^(\S+) (\S+) (\S+) \[(.+)\] \"(.+)\" (\S+) (\S+) \"(.*)\" \"(.*)\"/') ; /* Read line-by-line */ do _n_ = 1 by 1 until (end); input; start = 1; stop = length (_infile_); /* pattern matching */ call prxNext (rx,start,stop,_infile_,matchAt,matchLength); if prxMatch (rx, _infile_) then do; /* assign matches to SAS variables */ clientAddress = prxPosN (rx, 1, _infile_); rfc1413 = prxPosN (rx, 2, _infile_); username = prxPosN (rx, 3, _infile_); localTime = prxPosN (rx, 4, _infile_); httpRequest = prxPosN (rx, 5, _infile_); statusCode = prxPosN (rx, 6, _infile_); bytesSent = prxPosN (rx, 7, _infile_); referer = prxPosN (rx, 8, _infile_); clientSoftware= prxPosN (rx, 9, _infile_); output; end;/* assign matches to SAS variables */ else put _n_ 'regel is niet in Apache log formaat'; end; keep clientAddress--clientSoftware; run;