/* Example of Illegal ASYNC Block Code */
PROC SQL;
connect to sasspds
(dbq="my-domain"
server=host.port
user='user-name'
password='user-password'
other connection options);
execute(begin async operation)
by sasspds;
execute(create table T1 as
select *
from SRC1)
by sasspds;
execute(create unique index I1 on
T1(a,b))
by sasspds;
execute(end async operation)
by sasspds;
disconnect from sasspds;
quit;
/* Example of Legal ASYNC Block Code */
/* Creates some tables in the first ASYNC block */
/* */
PROC SQL;
connect to sasspds
(dbq="path1"
server=host.port
user='anonymous');
execute(begin async operation)
by sasspds;
execute(create table state_al as
select *
from allstates
where state='AL')
by sasspds;
execute(create table state_az as
select *
from allstates
where state='AZ')
by sasspds;
...
execute(create table state_wy as
select *
from allstates
where state='WY')
by sasspds;
execute(end async operation)
by sasspds;
/* */
/* Create some indexes in the second ASYNC block */
/* */
execute(begin async operation)
by sasspds;
execute(create index county on
state_al(county))
by sasspds;
execute(create index county on
state_az(county))
by sasspds;
...
execute(create index county on
state_wy(county))
by sasspds;
execute(end async operation)
by sasspds;
disconnect from sasspds;
quit;
/* Example of Legal Code using LIBREFs in an ASYNC Block */
/* Create some tables in the first ASYNC block */
PROC SQL;
connect to sasspds
(dbq="path1"
server=host.port
user='anonymous');
execute(begin async operation)
by sasspds;
execute(libref path1 engopt='dbq="path1"
server=host.port
user="anonymous"')
by sasspds;
execute(libref path2 engopt='dbq="path1"
server=host.port
user="anonymous"')
by sasspds;
execute(create table path1.southeast as
select a.customer_id,
a.region,
b.sales
from path1.customer a,
path2.orders b
where a.customer_id = b.customer_id
and a.region='SE')
by sasspds;
....
execute(create table path1.northeast as
select a.customer_id,
a.region,
b.sales
from path1.customer a,
path2.orders b
where a.customer_id = b.customer_id
and a.region='NE')
by sasspds;
execute(end async operation)
by sasspds;
disconnect from sasspds;
quit;
/* */
/* Example of Legal SQL Options in ASYNC Block */
/* */
PROC SQL;
connect to sasspds
(dbq="path1"
server=host.port
user='anonymous');
execute(reset noexec _method)
by sasspds;
execute(begin async operation)
by sasspds;
execute(libref path1
engopt='dbq="path1"
server=host.port
user="anonymous"')
by sasspds;
execute(libref path2
engopt='dbq="path1"
server=host.port
user="anonymous"')
by sasspds;
execute(create table path1.southeast as
select a.customer_id,
a.region,
b.sales
from path1.customer a,
path2.orders b
where a.customer_id = b.customer_id
and a.region='SE')
by sasspds;
....
execute(create table path1.northeast as
select a.customer_id,
a.region,
b.sales
from path1.customer a,
path2.orders b
where a.customer_id = b.customer_id
and a.region='NE')
by sasspds;
execute(end async operation)
by sasspds;
disconnect from sasspds;
quit;
execute(load table state_al
with index county
on (county) as
select *
from state
where state='AL')
by sasspds;
execute(load table state_az
with index county
on (county) as
select *
from state
where state='AZ')
by sasspds;
...
execute(load table state_wy
with index county
on (county) as
select *
from state
where state='WY')
by sasspds;
create table ... as select ... create index ...
execute(copy table t_new
from t_old)
by sasspds;
execute(copy table t2_new
from t2_old
without indexes)
by sasspds;