BookmarkSubscribeRSS Feed
Pdogra
Calcite | Level 5
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 ?
4 REPLIES 4
Doc_Duke
Rhodochrosite | Level 12
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.
Patrick
Opal | Level 21
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”).
DanielSantos
Barite | Level 11
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
Doc_Duke
Rhodochrosite | Level 12
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.)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 873 views
  • 0 likes
  • 4 in conversation