Help using Base SAS procedures

Submitting multiple Code for execution with PROC SQL - without waiting

Reply
Occasional Contributor
Posts: 16

Submitting multiple Code for execution with PROC SQL - without waiting

Hi there,
I am wondering if there is any option or methodology available with proc sql to excecute multiple code for e.g.

code Section a:
proc sql;
create table xyz as select ..............
quit;

code Section b:
proc sql;
create table abc as select ..............
quit;

The current way is code in section a will be executed and execution will passed to b.

Is there a way to have code in section a and b run concurrently as there are no dependencies ?
Trusted Advisor
Posts: 2,115

Re: Submitting multiple Code for execution with PROC SQL - without waiting

Probably not. That has to be designed in at the procedure level, so only certain procedures take advantage of multiple processors. For instance, SORT will use up to 10 processors and REG up to 4, but those are design features rather than something the user controls.

My experience with SAS SQL is that the rate limiting part is I/O, so even if you could execute these independently, I doubt that you would make much gain in overall time to completion.
Respected Advisor
Posts: 4,173

Re: Submitting multiple Code for execution with PROC SQL - without waiting

Have a look at things like: “X command”, “X statement”, “CALL SYSTEM routine”, “%SYSEXEC” and “SYSTASK”.
To use these commands within EG shell escape must be possible (-> run “proc options”, look for “xcmd”).
Super Contributor
Posts: 474

Re: Submitting multiple Code for execution with PROC SQL - without waiting

There is actually several ways of doing this.

Some maybe platform dependent. For example if your running on UNIX you could split the code in two sas programs and execute them separately (sas prog1.sas & and then sas.prog2.sas &)
Or you could issue from SAS the X command with the NOWAIT option set (executes asynchronously), which is the same thing but started within SAS.

Or (and this one, would be my favorite) if you want to control the threads from SAS (say, wait for both to end before proceeding with some other thing from SAS) and have the SAS/CONNECT licensed at your site, you could use the MP/CONNECT technique and submit both piece of codes each on a autosignon session.

see: http://support.sas.com/rnd/scalability/connect/mp.html

Greetings from Portugal.

Daniel Santos at www.cgd.pt
Trusted Advisor
Posts: 2,115

Re: Submitting multiple Code for execution with PROC SQL - without waiting

To follow on to Daniel's comment, if you are on a PC and willing to split the code into multiple SAS programs, the parallel to the Unix "&" would be to right-click on the code and select either 'submit' or 'batch submit' (Batch submit should run faster because it doesn't have to load all the windows display overhead.)
Ask a Question
Discussion stats
  • 4 replies
  • 116 views
  • 0 likes
  • 4 in conversation