BookmarkSubscribeRSS Feed
Rhys
Obsidian | Level 7

Hello, I'm trying to call a macro in EG with Parallel processing enabled. 

 

The macro is defined in one program that is then linked to multiple others which all call it. However it will only get called the first time and then is dropped from memory. 

 

If I remove the macro definition program and instead place a copy in the call scripts they all run in parallel. However I only want to define the macro once, so any changes aren't made multiple times. 

 

 

How do I define a macro across multiple parallel processes

Thanks

R

4 REPLIES 4
JuanS_OCS
Amethyst | Level 16

Hello @Rhys,

 

I am not the most expert here, so if I cannot help you, please wait a bit, there will be more colleagues willing to help you.

 

For me, as former java programmer, the answer would be simple, in a way. As you said, the problem is the multiple definition of the macro, but you can call it many times.

 

You can split your program on one, just to be executed once, where you can include the macro definition, and then the other, or other programs, to be executed recursively with parallel processing enabled, where you will be calling the macro as many times as needed.

 

Another option, mostly generalised, is to have a location only with macro code, and include its location on your sasv9_usermodes in the Workspace Server. See SASAUTOS option (between others) in here: http://documentation.sas.com/?docsetId=allprodslang&docsetTarget=syntaxByCategory-macroSystemOptions...

 

With this latest option, you won't need to define the macro again, every time you start an EG session, you will have the macro available for you.

Rhys
Obsidian | Level 7

Thanks for your reply. 

 

I was thinking of using %include however, the server is on Linux and the client is Windows so it's not easy to get a script into an area that is readable by the server.

Reeza
Super User

I'm assuming you do have some library space on the server? If so, can you compile the macro once and store it in the library?

 

http://documentation.sas.com/?docsetId=hosto390&docsetTarget=n0wlgcradj9wzzn115uk2rkw0xnd.htm&docset...

SASKiwi
PROC Star

You could turn your macro into an AUTOCALL one so it is available to all SAS sessions and can be called by any. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1241 views
  • 2 likes
  • 4 in conversation