01-24-2018 05:27 AM
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
01-24-2018 06:00 AM - edited 01-24-2018 06:01 AM
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.
01-24-2018 06:11 AM
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.
01-24-2018 11:03 AM
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?