I'm trying to automate a scheduled event in SAS so that when the SAS program opens it first runs a pass through query that creates a local table. I want this query to keep running in a loop until the observation count of that table is >0. The idea is that I need to wait for a confirmation from the data source that the table is ready before I can run additional code to the server which I would do after the macro. I would also like it to sleep for 10 minutes each time the table shows no observations.
My ODBC connection...
proc sql;
connect to odbc(datasrc="SSDM");
EXECUTE ( Create Volatile Table DataReady as
(
SQL...
) WITH DATA ON COMMIT PRESERVE ROWS;) by ODBC;
CREATE TABLE DataReady AS SELECT * FROM CONNECTION TO ODBC ( SELECT * FROM DataReady );
DISCONNECT FROM odbc;
quit;
and also include a sleep function...
data _null_;
rc=SLEEP(600);
run;