I have text with SAS code in it. Essentially it is SQL query wrapped between
PROC SQL;
.
.
.
.
.
QUIT;
I am trying to extract SQL in between as a single match.
This is how my text file looks like
***logic 1***
proc sql;
create table Combined as
select t1.name, t2.units
from mdweop.candy_customers_azim_056 as t1
inner join mdweop.candy_sales_history_set t2 on (t1.custid = t2.ORIGTN_ACCT_NO);
quit;
***logic 2***
PROC SQL;
CREATE TABLE COMBINED AS
SELECT T1.RPOG_HMDA_CODES, T2.RSN_DECL1_C
FROM MDWEOP.CANDY_CUSTOMERS AS T1
INNER JOIN MDWEOP.CANDY_SALES_HISTORY AS T2
ON (T1.CUSTID = T2.ACA_MISC_Z03HMDA_BV);
QUIT;
***logic 3***
PROC SQL;
CREATE TABLE COMBINED AS
SELECT T1.RRG_PRPS_CODES, T2.RSN_DECL1_C
FROM MDWEOP.CANDY_CUSTOMERS AS T1
INNER JOIN MDWEOP.CANDY_SALES_HISTORY AS T2
ON (T1.CUSTID = T2.ACA_MISC_Z03HMDA_BV);
QUIT;
I tried this regex but its finding each line as single individual match.
Ideally if i want to extract each SQL query from the text file
Any leads are well appreciated.