Hello Experts Dataset "a" created below is extracted from a log file In the data "b", I want to pull out the information about tables after t_table_list, using regular expression. How do I write the regular expression in data step "b" when the tables' name are displayed in multiple lines? There are thousands of log files, each can has more or less tables than the example provided below. I want to write a universal regular expression that allows me to extract tables for all the log files. for example, in log file 1, there is only 1 table after t_table_list . But in log file2, there could be 100 tables. So I need the regular expression as flexible as possible. data a; length line $500; infile cards dlm="*" truncover; input line $150.; cards; 87 %check (t_table_list=CUTP_TPCR_PIMS 88 CUTP_CTP_CUTG 89 CUTP_TPCR_PIM 90 CUTP_TPCR_PIMQ 91 CUTP_CTP_CUT 92 CUTP_CTP_CUT_C 93 CUTP_CTP_CUTN 94 CUTP_CTP_CUAD 95 CUTP_CTP_CUTC 96 CUTP_TPCR_PIML, 97 l_file_list=, 98 s_file_list= 99 ) run; data b; set a; array rearr {*} regex1; array posarr {*} pos1; array colarr {*} check; keep line check ; dimm=1; if _n_=1 then do; rearr{1}=prxparse("/.*check\s*.*t_table_list=(.*)/i"); end; retain regex1; do i=1 to dimm; posarr{i}=prxmatch(rearr{i},line); if prxmatch(rearr{i}, line) then do; wf=prxparen(rearr{i}); call prxposn(rearr{i},wf,posarr{i},len); colarr{i}=substr(line,posarr{i},len); end; output; end; run; Thanks
... View more