Learning SAS? Welcome to the exclusive online community for all SAS learners.

How to run codes PARALLELY?

Reply
Occasional Contributor
Posts: 11

How to run codes PARALLELY?

Hi, I've six blocks of code. What I want is  As code first takes lot of time to run, I want to run first then six and  run two to four concurrently and I want them by a single sas code.. what I was doing I am using %include statements but this is not solving problem. Could there be any way by which I can run it parallely? Please help

Super User
Super User
Posts: 7,401

Re: How to run codes PARALLELY?

Not using SAS Analytics am just guessing a bit here, but can you not just open another instance of the Analytics application? 

Occasional Contributor
Posts: 11

Re: How to run codes PARALLELY?

But I want that in same session and in a single code.

Super User
Super User
Posts: 7,401

Re: How to run codes PARALLELY?

You cannot multi-thread a program yourself if that's what you are attempting to do.  SAS programs run iteratively, code is read block by block and executed.  You can change the order this happens in, as you have mentioned with moving %include statements, but not run then at the same time.

Occasional Contributor
Posts: 11

Re: How to run codes PARALLELY?

So is there any way by which I can just execute the program and it automatically open another session for execution of codes...

Super User
Super User
Posts: 7,401

Re: How to run codes PARALLELY?

Well, there is the proc ds2 options as mentioned previously, but you need 9.4 for that.  Otherwise it is tricky.  You could theoretically use the system command X to run sas.exe with a file name.

TBH I don't see what you are trying to achieve.  If your code takes a while to finish, then look at some optimization/break the data down.  Is that code related to other steps, if so then it needs to be finished before other ones.

If you really are running a universe simulation and require full multi-core processing, then invest some time in learning .NET/C++/Java, and write some software to do multi-threading.

As for EG/Connect, I do not know.

Respected Advisor
Posts: 3,124

Re: How to run codes PARALLELY?

Regular Contributor
Posts: 213

Re: How to run codes PARALLELY?

if you have SAS/CONNECT product licensed, then you can use MP Connect to spawn several SAS jobs in Parallel from within a single SAS session.

Here are few links to review:

Scalability Community: SAS/CONNECT Software

Tips and Tricks for Scalability and Performance

Note: the links apply to all SAS 9.x versions!

Hope this helps,

Ahmed

Super User
Posts: 3,105

Re: How to run codes PARALLELY?

If you are running a browser-based version of SAS, aka SAS Studio or SAS University Edition, then running code in parallel is not possible. You can have multiple SAS sessions open, but then you would have to split your code so that it can run independently without each session being aware of the other.

SAS EG (Enterprise Guide) and Foundation SAS/SAS Connect provide parallel running capabilities.

Valued Guide
Posts: 3,208

Re: How to run codes PARALLELY?

As you are at analytics_U webbased you do not have any options for parallel work. It is limitited by that intentionally

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 9 replies
  • 896 views
  • 0 likes
  • 6 in conversation