BookmarkSubscribeRSS Feed
Fisher
Quartz | Level 8

We have a set of standard Macros in our local server. I wonder how to include these macros in my SAS program and run the program in remote server? thanks

5 REPLIES 5
Patrick
Opal | Level 21

If I understand your question right then you're using mp-connect (rsubmit blocks).

If so then below link should answer your question: http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/viewer.htm#a002590516.htm

Tom
Super User Tom
Super User

%SYSLPUT (and the reverse %SYSRPUT) will work for macro variables.

Tom
Super User Tom
Super User

You could upload the source code for the macro definition and then either %INC it or autosource it.

filename local 'local path';

rsubmit;

filename remote 'remote path';

proc upload infile=local('xxx.sas') outfile=remote('xxx.sas') status=n; run;

%inc remote('xxx.sas');

...

Do they change frequently?  If not then just copy them to the remote server once and point to them the same way that you point to them on your local SAS sessions.

Fisher
Quartz | Level 8

Thanks Tom and Patrick.

What we don't want is to keep two copies of macros (one in local PC, the other one is in remote UNIX server). Instead we prefer to keep only one set of macros in our local machine to facilitate the management. I didn't try the proc upload yet, but just wonder whether there is any other better way to implement it.

Quentin
Super User

Hi,

One option is to run Samba on the UNIX server.  I haven't administered it, but as a user the end result is that the autocall library is sitting on the Unix box, but in windows you can map a drive to it.

So the macro definitions might sit in /autocall

And your PC config.sas would point to Q:/autocall.

That worked great (only gotcha is that on unix, the filenames in the autocall library have to be lowcase!).

I don't have Samba where I'm set up now, so agree it would be nice to have a solution for this.  Currently I just copy files from Windos to Unix when I update the macro library, which isn't that often....

--Q.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Lisa Mendez & Richann Watson present Get Tipsy with Debugging Tips for SAS® Code: The After Party on Wednesday Jul 16.
Register now at https://www.basug.org/events.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 4382 views
  • 6 likes
  • 4 in conversation